• Appoxo@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    5 hours ago

    How come Git is decentralized?
    Doesnt it need a central component so I can pull your changes?

    Edit: Thanks to all that explained it to me :)

    • KubeRoot@discuss.tchncs.de
      link
      fedilink
      English
      arrow-up
      2
      ·
      7 hours ago

      Fundamentally, the repository you have on GitHub is the same thing as the repository you have on your computer when you clone it. Pulling and pushing are shorthands for synchronizing commits between the two repositories, but you could also synchronize them directly with somebody else who cloned the repository. As somebody mentioned, you can also just host the same repository on two servers, and push to both of them.

      The issue is that git doesn’t include convenient features like issues, pull requests, CI, wikis, etc., and by extensions, those aren’t included in your local repository, so if GitHub takes them down, you don’t have a copy.

      An extra fun fact is that git can be considered a blockchain. It’s a distributed ledger of immutable commits, each one representing a change in state relative to the previous one. Everybody who clones a repository gets a copy of its entire history and fast forwards through the changes to calculate the current state.

        • thevoidzero@lemmy.world
          link
          fedilink
          English
          arrow-up
          2
          ·
          4 hours ago

          Git works through ssh. So you need the same system as sshing into your machine. You just make a user group git and then let git and ssh handle things. And if you don’t need people to push to your repo, then it’s a lot easier as it’s now similar to hosting a website/file server.

    • FurryMemesAccount@lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      7
      ·
      13 hours ago

      You can have arbitrarily many git “remotes”: GitHub, gitlab, your own custom forge, etc…

      Git a cmd tool only. Your can remote wherever you like.

    • expr@programming.dev
      link
      fedilink
      English
      arrow-up
      4
      ·
      12 hours ago

      Changes can come from anywhere. The Linux kernel itself doesn’t use any central repository like Github, it’s instead done via emailing patches that are eventually merged into the mainline kernel repository managed by Linus.

      It is 100% decentralized.

      • Lka1988@lemmy.dbzer0.com
        link
        fedilink
        English
        arrow-up
        2
        ·
        4 hours ago

        mainline kernel repository managed by Linus.

        It is 100% decentralized.

        But… How does that work? The code has to be stored somewhere

        • who@feddit.org
          link
          fedilink
          English
          arrow-up
          1
          ·
          edit-2
          15 minutes ago

          How does that work? The code has to be stored somewhere…

          The code is replicated by everyone who works on it, and on various public and private servers, so you might say it’s stored everywhere.