Why git is called a distributed source control system?

前端 未结 5 799
猫巷女王i
猫巷女王i 2021-02-15 23:23

It seems after committing code to the local repository, every programmer will run the command.

git push origin master

to push the local file to

5条回答
  •  逝去的感伤
    2021-02-16 00:17

    Short Answer

    It is not different with client/server model except a local copy, so why is it called a "distributed" one?

    In the diagram below alice and david can interact because the system is distributed.

    Distributed Version Control

    Distributed control

    Notice how, say, alice and david can interact because each can act as a server.

    Central Version Control

    Central control

    Here the dev team only interacts with the main server.


    Long Answer

    Traditionally speaking source control systems were designed as server-client setups, loosely speaking. So the repository was centrally located.

    With git and Mercurial, the system is designed to put all users at equal footing. Everyone has the full repository with them. The control and repository in that way is distributed amongst it users.

提交回复
热议问题