Git was invented by the Linux project in order to move beyond the crappy solutions they had in place before, and since then it has established itself as the de facto standard for version control and software collaboration.
But I'm wondering if, now that we've lived with git for a while, are there any clear alternate approaches we could be considering for what we do in software development. Git is not exactly the easiest thing to not mess up.
But it can be hard to even imagine an alternative to such an ingrained practice, but I'd love to hear any thoughts on the subject at all.
Oldest comments (49)
I think Git is simple enough to create tools over it (like Github) in order to extend it.
Example: Pull Requests aren't a feature of Git, but nobody would use a version control platform (Github, Gitlab, etc.) without that feature which was built upon Git branches.
So instead of doing Git again from the ground I think is better to just improve tools built upon Git, maybe simplify the flow to avoid messing it up.
That's reasonable. Git could be a bit like the assembly language for version control. Regardless of abstractions you build, it compiles to git for compatibility and leverage the immense work put into it.
Git Flow, anyone?
Oh nice, I remember this but had forgotten about where I read it.
Curious about what alternatives already exists right now? I've only used git. Is there any other version control system in use today? If there are, what are the differences?
If you could change anything about the way git works right now, what would it be? Looking at the OP, I suppose you would like it to be more beginner-friendly?
There's Mercurial aka hg. I started with it about 7 years ago because git was "too hard". I couldn't find explanations about what "origin" or "HEAD" are and it all looked like a mess. So hg was much better (read: simpler) for me at the time. I don't quite remember the details but eventually I started looking at git and GitHub was also gaining popularity. It never had Mercurial support unlike BitBucket which I think I used back then. I sorted out all the essential knowledge about remotes, refs, commit hashes (instead of monotonically increasing revision numbers in hg) and switched in the end.
I never looked back.
Could there be another solution that optimizes in the other direction: Like, not caring as much about scalability, but focusing on productivity and safety at the early stages? Maybe with a built-in path to git when the time comes?
TFS is pretty easy to use for those of us in the Microsoft world. But if I'm doing anything else (even .net core) git is my go-to.
And even TFS has Git built in now which I believe is the recommended setting for new TFS installs.
Run away from TFS version control. It's a trap! :-)
Git is the classic example of something that was invented to solve one problem, but ended up solving a different, more important problem along the way. For that reason, I do think that Git could (nay, will) eventually be supplanted by something better, something that directly addresses the more important problem that Git solved by accident.
To be more specific: when Linus created Git, his goal was to create a version control system that would be fully distributed. You have to understand, he was targeting the Linux kernel, a project which is extremely widely distributed and for which there are many "sources of truth". In other words, the goal was that the Linux Foundation could host a Git server with history, branches, and tags for the "official" Linux kernel, but RedHat or Canonical or Debian might also host Git servers with their own branches, history, and tags for kernels that are just as complete as the "official" version.
Most teams, however, don't have more than one "source of truth". Every time you see people complain that "GitHub is down", what they're really saying is "even though Git is fully distributed and capable of supporting multiple 'authoritative' nodes, we've agreed on using GitHub as the de facto central repository we all depend on".
Why is it, then, that so many people use a version control system when they're not interested in its raison d'être? Because along the way Linus solved a smaller, but much more valuable, issue: local versioning.
Young coders may not remember, but back in the bad ol' days of Subversion, if you wanted to save something you were working on so that you could move on to something else, your choices were: a.) save the file locally, then try and walk back the changes when it came time to
svn commit
, or b.) make sure you are connected to the Subversion server,svn commit
, and pray there are no conflicts with anything anyone else was working on.Actually, there was a 3rd option known as "SVK". On the surface,
svk
worked much likegit
does today: you would keep a copy of the Subversion repository locally, to which you could commit as needed, and periodically you wouldsvk sync
with the main Subversion repository.So, I honestly believe that Git "won" not because it is completetly distributed, but merely because it allows developers to work locally at will, and synchronize centrally only as needed. Really, this is a natural progression from the earliest version control systems where you would have to actually lock a file on the central server before you could edit it, to Subversion which did away with locks but still required access to the central server in order to version changes. Some new system that focused more on the local developer experience, and simplified the "central repository" situation (since the vast majority of teams will only ever have one central repository), could easily eat Git's lunch.
Great reply
This is a good response, though I think it is missing one fairly important point in the why git was created portion. Bitkeeper, the original VCS for linux, originally had extremely restrictive licensing, but was free (money) for open source projects. Then in 2005, changed the licensing to start charging open source projects too. Most developers in the project would be able to purchase the software, but due to a separate project being worked on by the OSDL (Linux foundation now) that infringed on the restrictive licensing made it so that anyone working for the OSDL (Linus Torvalds) couldn't use the software.
Linus, in his typical Linus-y way, flipped Bitmover a bird and built his own, git, "the stupid content tracker". Bitkeeper was distributed and had most of the features necessary, but was too restrictive.
The distinction between a different branches and repositories is what makes git so genius. There is none. Just because you call your local branch master and I call my local branch master doesn't mean we are both on the same branch. Rebases and merges work the same when performed against local branches and remote branches. The use of a cryptographic content addressed object store is what makes this work. Syncing is as simple as exchanging read only objects.
So, even though teams don't necessarily use many remotes, they do use loads of branches, which is why they need Git. There are at least n+1 branches where n is the number of people plus whatever feature, production, developmnent, etc. branches people create. On my team that means well over a thousand in the past six months. Some branches are long lived, some are short lived.
Github is just a convenient way to synchronize change. Most teams use it incorrectly by allowing multiple individuals to write to the same repository instead of cloning and creating pull requests.
There is still plenty of room for improvement. Git is not very usable for non experts. A lot of the complexity has to do with dealing with the many ways merges and rebases can fail to work as expected. One limitation here is that a merge commit typically has only two ancestors. Git actually allows for more than two but the porcelain just does not use this. There have been some alternatives where this is used to track changes from multiple branches.
Another area where Git is struggling is larger code bases. The linux kernel is not small but there are examples of big companies where git just isn't good enough for tracking everything they have in one repository. E.g. Google does this (not using git for that). So scale is an issue. Then even though git is distributed, it is not sharded. This imposes upper limits on what can be in a single git repository. The model has always been that you need the entire repository locally to be able to work with it. Wouldn't it be nice if you'd only need a subset of that to be able to work.IPFS copies some of the design for git and stores content addressed objects in a distributed FS. Wouldn't it be nice if somebody rebuilt git on top of that?
So, there's plenty of room for improvement in the Git world.
Well i know it's not Sharding. but if you need a Subset of a git repo you can do a shallow clone.
I find that useful for Repo's that are very large.
Unless I'm misunderstanding, Microsoft actually built an implementation to allow working with a subset of files in a repo. They called it Git Virtual File System in case you want to check it out!
Here is an article about changes MS had to do to Git, interesting read
arstechnica.com/information-techno...
Subversion... I used to dream of Subversion. I had to use CVS.
But anyway - Subversion did something truly amazing. People had used CVS - which is itself based around RCS - for so long that it'd somehow become a fact of life that version control systems were too difficult to write.
Even BitKeeper was itself based on RCS. And of course BitMover forbid anyone using BitKeeper - paid or not - if they worked on any other version control system.
Once Subversion proved that version control systems were, in fact, things which ordinary mortals could write, then suddenly everyone was writing them.
I used to just keep a copy of the entire Subversion checkout in another directory, then diff -qr them and rsync them as needed if I wanted to work on a local branch. I'm pretty sure that was common practice and it's basically just a manual way of doing what git does.
Git made it easier by reducing the friction and fragility of local history management, and Github made it "win" because the interface was so much prettier than WebSvn and because it was entirely hosted and mostly gratis.
I don't know anyone working in a company who has a second "source of truth" beyond GitHub, Bitbucket, or their local machine these days.
Sorry sir, what do 'authoritative' nodes mean?
I think there's some definite value to something like this if you get the right buy-in and do it the right way. I think that's a pretty herculean task, but I wouldn't be surprised if something like that could get some legs if executed on right.
Fossil looks interesting. It was created by Richard Hipp who also runs the sqlite project.
Here's a talk about the problems he sees with GIT:
I love Fossil. It has its quirks, as do the alternatives (Git, Mercurial, et cetera), but it provides what I need much more effectively and with far less hassle than those alternatives. In fact, I've been doing more and more of my work in Fossil, and I host my open source Fossil repositories on the web. I'm not sure I'll ever create another repository in Git that isn't a clone of a Fossil repository again, except when I'm somehow required by someone else (e.g. an employer) to do so.
Speaking of clones, I wrote a fairly simple tool in Ruby, called FossGit (
gem install fossgit
), to mirror my work in Fossil repositories on GitHub. The GitHub network effect is too valuable to ignore, at this point.That's awesome, Chad. Thanks for sharing.
I do not think Git will be the premier SCM solution forever, but I think it is the best of the 3 that I know of and have worked with (Git, Subversion, Mercurial).
The CLI API is complex enough that it allows for segmentation of operational tasks (adding files per-commit, committing and pushing without having to commit/vice versa, directory structure-agnosticity), but is also simple enough and helpful enough that a beginner could learn it in short order using an existing project/directory.
Despite personal preference, Git appears to have won the sprint, however, considering the propagation of the SCM in the open source community.
Git is, in my opinion, one of the most brilliant pieces of software ever written (I'd go as far as saying it's Linus' biggest achievement, rather than Linux). It's an example of software that's so well designed that it keeps surprising you (well me, at least) by its versatility and performance.
By now there aren't any serious competitors left and maybe that's what's triggering you to ask "aren't there alternatives". In other areas (backend frameworks, frontend frameworks, operating systems, etc etc etc) there are dozens of alternatives with none of them clearly superior, but Git is indeed dominant, but I'm saying deservedly so.
For me it's a breath of fresh air to have at least one area where I'm not bogged down by too many choices with no clear added value.
Add to that the huge installed based (just Github alone but also in enterprises) and the huge boost which Git (and Github) are for OSS and "social coding" (sharing, contributing) - then the conclusion for me is that any alternative has to be clearly superior, not like 50% or 100% "better" but an order of magnitude better, otherwise it won't stand a chance.
That's a very good take.
I really hope not. It has great features but a terrible interface. The command-line is a chaotic mess of inconsistent names and patterns. There are numerous ways of doing certain things, yet there is a lack of orthogonality, meaning things like syntax referring to a remote differs depending on the command.
Using git feels like navigating planks laid across a swamp. One wrong move and you've screwed something up. This is not exactly inspiring for version control.
I prefer the consistency (and UI tools for that matter) of bzr. It's much harder to screw things up, and I don't find myself constantly looking for references online. Granted, I tend not to do as much in bzr than git, but still, it just feels easier.