Ask HN: Mercurial vs git - is there an even-handed comparison?
I have a small project with the potential to grow. We are a disparate team in different time-zones and with different outside commitments, and we're trying to pick a distributed source-code versioning system to use. To some extent we don't much care, but it would be nice to see an even-handed comparison between our two main contenders - Mercurial and git.
References welcome, and thanks in advance.
10 comments
[ 3.0 ms ] story [ 28.5 ms ] threadHg, overall, seems a bit more user friendly for doing the run-of-the-mill things such as branching, merging, fetching code, delivering patches, etc. I find it more pleasant to use without knowing much about the internals. This makes it also easier to explain to people that used SVN etc.
Git has a lot of 'magical command line switches', and (at least used to be) documented qutie sparsely. So you'll probably query google on how to get out of seemingly simple situations. On the other hand, Git allows a guru to do a lot of stuff such as re-ordering history to make nicer patches. Once you master how things work, these can be very useful.
IMO, it doesn't really matter that much, you'll get used to both, and Hg and GIT are more or less equivalent feature-wise.
Link to explanation of branching model: http://nvie.com/posts/a-successful-git-branching-model/
Link to git-flow plugin: https://github.com/nvie/gitflow
Link to video intro for git-flow: http://vimeo.com/16018419
In brief:
The strength of Mercurial is that it has a fairly simple set of basic commands. These commands are easy to use and the documentation for these commands is way less daunting than those for git commands. Using Mercurial out of the box, without enabling extensions, it is harder to screw things up in a way that destroys history. At the same time, it may be harder to manipulate the contents of a Mercurial repository in ways you want. However, there are extensions for Mercurial, some third-party, some that come with the system, that let you do many of the manipulations that git provides.
Git's command set and UI are more complicated than Mercurial's. But, you don't have to learn them all at once, so just getting to a point where you can get basic stuff done isn't difficult. The strength of git is that it has fairly straightforward conceptual underpinnings, and once you start thinking of commands in terms of how they manipulate the underlying structure of your repository (see, for example, http://www.slideshare.net/chacon/getting-git for details), it's a very empowering system (or, if you're a pessimist, you've been given enough rope).
A not uncommon pattern is for people to start out with Mercurial, perhaps because the learning curve isn't as steep or because it had clearly better Windows support at one time, and then switch to git as their usage pattern requires more complicated functionality than Mercurial easily provides. An example of this is: http://lucumr.pocoo.org/2010/8/17/git-and-mercurial-branchin...
With git, the system is so simple to understand, and so finally it makes sense. The commands are rather clean and friendly. I don't have anything to complain about.
With hg, it's almost back to svn. I didn't really know how things worked; I never wrapped my head around it, so I never used it.