250
57
I have used Git at my past two companies for version control. It seems from what I've heard that about 90% of companies use Git over other version control systems.
One of the biggest selling points of Git is that it is decentralized, i.e. all repositories are equal; there is no central repository/ source of truth. This was a feature Linus Torvalds championed.
But it seems that every company used Git in a centralized manner, much like one would use SVN or CVS. There is always a central repository on a server (usually on GitHub) that people pull from and push to. I have never seen or heard of (in my admittedly limited experience) people using Git in the truly decentralized manner in which it was intended, i.e. pushing and pulling to other colleagues repositories as they saw fit.
My questions are:
- Why don't people use a distributed workflow for Git in practice?
- Is the ability to work in a distributed manner even important to modern version control, or does it just sound nice?
Edit
I realized I didn't get across the correct tone in my original question. It sounded like I was asking why anyone would work in a centralized manner when a distributed version control system (DVCS) was so obviously superior. In actuality, what I meant to say was, I don't see any benefits to DVCS at all. Yet I often hear people preaching its superiority, while the real-world seems to agree with my view.
29I feel the exact same way, and do not understand this. – StevieV – 2016-04-09T15:42:59.650
54Personally, I just don't know of any use cases for multiple remotes, other than forks for creating PRs to the main remote. The distributed thing is still useful because it means I get a complete history on my machine without having to talk to the network, and I can do some work offline if I really want to, and it's much easier to migrate from one online repo host to another. What exactly do you have in mind when you refer to a "distributed workflow"? – Ixrec – 2016-04-09T15:56:54.997
40I am fairly certain Torvalds intended from the beginning to have one "source of truth" Linux Kernel repository. – Steven Burnap – 2016-04-09T16:00:02.810
5Having a team of 10, it doesn't seem very practical if they all have to pull from each other? Where will the 'final' code be for e.g. a release? What if a collegue has a critical piece but you haven't pulled from him, then he leaves on vacation without internet access? Etc.. – stijn – 2016-04-09T16:03:45.347
63Ultimately, software itself is centralized. Customers don't buy branches or remotes, they buy a final, put-together, built product. There always needs to be some central path forward. – Brandon – 2016-04-09T16:19:02.130
3Just because your company needs to release exactly one controlled version of its software doesn't mean that its developers can't benefit from working decentralized among themselves while developing that one, central version. Git allows them to do this. – Galik – 2016-04-10T15:11:21.070
35To me git's "decentralized-ness" is one of the least important features recommending it. The ability to do frequent commits and rollbacks locally, without affecting anyone else, or powerful techniques such as rebasing are where git really shines in my workflow. It's possible (indeed probable) that all these are made possible by being decentralized, but the "D" in DVCS isn't that important by itself to me. – Jayraj – 2016-04-11T00:16:10.263
3@Jayraj "To me git's "decentralized-ness" is one of the least important features recommending it. The ability to do frequent commits and rollbacks locally, without affecting anyone else, or powerful techniques such as rebasing are where git really shines in my workflow." Aren't those abilities precisely part of it being decentralized? You have your own repository, which means that you can have things locally, without needing to talk to a central server. – Joshua Taylor – 2016-04-11T16:48:04.557
1@JoshuaTaylor Like I said it's probable that being decentralized allows git to do all these things (I don't know enough about VCS design to know for sure). But one could still build a DVCS that doesn't have local commits or rebasing; the "D" is necessary but not sufficient. EDIT: I guess a DVCS without local commits is kind of stupid and unworkable. But rebase isn't necessarily a given with "distributed-ness". – Jayraj – 2016-04-11T17:13:34.447
You are not forced to work like this by the technology, but you may choose to work like this (as you most likely need a canonical place for the released sources). – Thorbjørn Ravn Andersen – 2016-04-11T18:49:38.633
1There is a difference between decentralized and distributed. – Elin – 2016-04-12T03:08:22.820
3Servers are always available. Your co-workers might be sick. It takes extra work to start the git server, and open ports on routers, and ensure authentication. When GitHub was down and my co-worker pushed/pulled changes directly to me, that's when I realized the power of Git. I've never needed it since however. – Chloe – 2016-04-12T04:00:49.277
5Really you should play with a non-distributed VCS like Subversion over an unstable link to a far, far away server. Or even without any connection the server whatsoever. Then you will understand. – sanmai – 2016-04-12T05:57:46.020
Comments are not for extended discussion; this conversation has been moved to chat.
– Yannis – 2016-04-14T11:15:06.3001Your premise is flawed: In practice, each maintainer has their own tree and they use git in a decentralized manner. – Navin – 2016-04-15T00:01:56.140
1I like this question. On our teams people won't even use each other's feature branches, everyone wants a merge to develop before they work on their own part. – lorddev – 2016-04-21T14:32:08.583