views:

10360

answers:

8

Going by the number of questions on this site for these three distributed version control systems, it seems like Git either

  1. is more popular, or
  2. is more difficult (hence requiring more questions), or
  3. has more features (hence requiring more questions).

Or most probably a combination of the three. (Let's say that popularity on this site equates to popularity at large.) Here are the numbers:

                          | Jun 2009 | Jul 2010
    -------------------------------------------
    [subversion] or [svn] |     2353 |     5323
    [git]                 |      726 |     3725
    [mercurial] or [hg]   |      169 |     1120
    [bazaar] or [bzr]     |       50 |      159

It's not entirely satisfactory having three competing yet largely equivalent open source products to choose from. Personally I use Git and I'm fine with the other two. But when it comes to recommending one system over the others, I'd like to ask: can we start recommending one safely yet?

Comments from mid-2009: The recent historical popularity of Subversion is clearly reflected by the number of questions, indicating at least a small tipping of the scales towards Git over the Mercurial or Bazaar.

Comments from mid-2010: Look at that huge relative increase in Mercurial numbers. Obviously only two-data points aren't enough to show a trend, but it looks like Git and Subversion are largely entrenched, Mercurial has seen a lot of growth, and Bazaar has remained relatively quiet.

+4  A: 

Well the reason that git has so many users is that the Linux kernel uses it, so if you want to do Linux development, you use git.

Since so many people are involved with git, I'd recommend using git, simply due to the larger user base. In fact, the numbers you show above are a clear sign of this.

As for difficulty, all version control is difficult, especially the distributed kind. SVN and CVS weren't exactly easy (for me at least) at first glance. This is just part of the necessary learning curve of getting used to a version control system.

EDIT: Since you added a subversion reference, I figured I'd address it. I think most people will use svn because it has all sorts of pretty GUI interfaces for it. In general, people hate to use the command line, including some developers. git typically does not work very well on Windows either (or at least not as seamlessly). Since many people are on Windows, this kills the number of potential users.

In addition, I think the concepts of SVN are a little easier to grasp since svn uses a central repository rather than a distributed system. It's easier to understand, "Here is the big mountain of code, please add your code here," than "Here is some code, mine might be different from his, his from hers, but you can add something if you wish."

In my opinion, svn has a much better system of documentation set up. git's documentation is targeted to a little bit higher level of knowledge (of the program, not a programmers intelligence) and so makes sense after you use the system, but when first start, it just looks like a bunch of gobbeldy-gook.

Overall, I think svn is and will always be more prevalent because its general operating concepts are easier to understand, the tools are easy to use, and it has wonderful support on Windows.

Let me end with my final two cents though and say that I much prefer git because I think it's much more powerful than any other system I've used. Climbing the learning curve definitely pays off once you begin to understand the program better.

samoz
+5  A: 

Since the origin of social coding with Git at GitHub, Git seems to have attracted lots of followers.

Alan Haggai Alavi
Doesn't answer the question, but I agree. GitHub is just fantastic; although I believe bitbucket and others have stepped in to fill the gap for the other DVCSs.
Will Robertson
Yeah, to setup bitbucket is easier than GitHub. It's really straightforward as you can also use http if you can't be bothered with ssh.
jpartogi
+3  A: 

An interesting blog post from Eric Sink about them all.

pjbelf
See also comments for this blog, and the following thread on git mailing list about Eric Sink blog posts: http://thread.gmane.org/gmane.comp.version-control.git/117659/
Jakub Narębski
+43  A: 

One point consistently missed is:

they are different in their nature.

  • SVN is a REVISION system (it stores branch and tag through cheap copy only! Merge support is not very efficient), and it is centralized.
  • Mercurial or bazaar are FILE VCS (they store versions of files), and distributed
  • Git, and that is very hard to grasp, is a CONTENT VCS (it stores delta of content, not the file itself: two files with the same content will be stored only once)

That means:

  • if you have a simple merge workflow, in a single development location, stick with SVN
  • if you have several development places, a distributed VCS is more adapted.
  • if you have a complex merge workflow, any modern VCS is better than SVN which struggle to keep merge informations at the right places for years. It then depends on the tools (Mercurial has a more advanced Windows support for instance)
  • if you have mainly text file and not too-large binary files, Git is excellent, provided you are aware of its limits.
VonC
I don't think the difference between git and mercurial is as large as you think it is. If implicit content tracking works so well in git, then why is there a git-mv command? http://www.kernel.org/pub/software/scm/git/docs/git-mv.html
Wim Coenen
@wcoenen: Mercurial is based at its core around revlog ( http://www.selenic.com/mercurial/wiki/Revlog ) linking a *file* to its history. That is a fundamental difference with Git blob. Not sure where you are going with git mv though. It concerns Git index (collection of *contents* to be committed), as opposed to Mercurial "working directory" and its "dirstate" (listing the change set -- of *files* --) to be committed. They may have the same external behavior, their internal mechanism is really different.
VonC
@VonC: Why is it important that Git tracks the content of files instead of the files themselves? Given tools like hg-git (http://hg-git.github.com/) which provide full round-tripping between Mercurial and Git, I think it's clear that they are equivalent in expressive power.
Martin Geisler
@Martin: "important"? While I did not said "important", it is actually important for the way Git was designed ( http://thread.gmane.org/gmane.comp.version-control.git/27/focus=217 ). True DAG history (without linear history kept for a file). The workflow is a bit different (see also http://rg03.wordpress.com/2009/04/07/mercurial-vs-git/ )
VonC
@Martin: "I'm a PhD student at the University of Aarhus, Denmark and a developer on the Mercurial project." Whoaa. Please consider I am not trying to pretend one is "better" than another;) As said in this blog entry: "Git vs. Mercurial: Please Relax" ( http://importantshock.wordpress.com/2008/08/07/git-vs-mercurial/ )
VonC
@VonC: I thought you made the list in order to highlight that the distinction between a file-based and content-based system is important (for the users). That's why I asked. Apart from that, I agree that people should relax and that both Mercurial and Git are powerful systems -- you linked to some good blogs to prove that point.
Martin Geisler
+8  A: 

I use and recommend mercurial

  • rather than subversion because it supports distributed development. I can work on several machines and commit locally. You can't do this with subversion, at least not without somersaults like additional repositories
  • rather than bazaar because bazaar's windows support is ... well.
  • rather than git because it is a) simpler to learn and use and b) windows support is much better
Conrad
IMHO Mercurial has worse than Git support for multiple named branches in single repository and interacting with more than one repository, and for tags. But that is just my opinion, and using single repository for single (visible) branch might be simpler for you.
Jakub Narębski
Can you explain this: "rather than bazaar because bazaar's windows support is ... well."? I don't understand your point.
bialix
Bazaar support for windows has some problems, at least when I last tried. especially if committing from a mix of windows and linux machines
Conrad
What the problems exactly?
bialix
Read this link https://lists.ubuntu.com/archives/bazaar/2009q1/054082.html for details
Conrad
@Conrad: The given link doesn't really show an issue with Bazaar, more with the usage of Windows tools in general... (proper editors and such). Beside, the recent versions improve Windows support (with EOL filters and similar). Still not perfect (with Unicode chars in file names for some commands, for example), but improving...
PhiLho
+7  A: 

One advantage of any of the three over subversion is that it doesn't create an equivalent of a ".svn" folder in every folder of the project. Usually just has one (".hg", ".bzr" or ".git") in the base folder. That alone can be a good reason to use one of them over svn even if you are using a centralised repository model. (Aside: In fact, I often use svk as my svn client when using a svn repository just for this feature (linux only though, svk is not good on windows)).

Of course, one advantage of subversion is you don't have to check-out the entire project if you only need one of its sub-folders.

Evan
Aah. That's a good thought. Thanks.
jpartogi
+19  A: 

Going by the number of questions on this site for these three distributed version control systems, it seems like Git either

  1. is more popular, or
  2. is more difficult (hence requiring more questions), or
  3. has more features (hence requiring more questions).
  1. About SCM popularity -- see the following StackOverflow question: Are there any popularity / usage statistics available for the Free RCS/SCM/VCS systems?. Here we have questions like what set of ignore files to use for specific kind of project, which are SCM agnostic, but are asked for Git (and using 'git' tag), because it is what person who asked question use.

  2. About Git being more difficult (and therefore having more questions about on SO) -- certainly Git has steeper learning curve. It also uses few (quite) unique concepts, like the staging area (the index), or all branches being equal, which are responsible for its power, but might be difficult to get right at first (especially if one comes from other SCM). Also Git UI is not completely consistent (although it gets better), because it was grown rather than developed; which is responsible for its power, but might lead to suboptimal user interface.

  3. About Git having more features -- you would have to check how many SO questions are about advanced / uncommon features of Git. You should be aware however that open source projects borrow ideas from one another, or have similar features developed independently: one example would be finding bugs by bisecting (searching) history for commit that introduced the bug which was (as far as I know) developed first in Git, and then implemented as plugin in Bazaar, and first extension and currently core functionality in Mercurial. Another would be interactive selecting fragments of changes to commit, inspired by Darcs behaviour. Yet another would be Git's bundle idea, borrowed from similar concept in Mercurial.

  4. Yet another possibility of source of larger number of SO question might be lack of good documentation... although it gets better nowadays with Git User's Manual (distributed with Git) and Git Community Book (found on Git homepage). Still there is this persistent meme that Git has worse documentation than, say, Subversion with its Version Control with Subversion (also known as svnbook) and Mercurial: The Definitive Guide (also known as hg-book)... and people do not read documentation before asking question on StackOverflow, sometimes.

It's not entirely satisfactory having three competing yet largely equivalent open source products to choose from. Personally I use Git and I'm fine with the other two. But when it comes to recommending one system over the others, I'd like to ask: can we start recommending one safely yet?

Well, Git and Mercurial were developed independently starting at nearly the same time in the response of terminating free license for BitKeeper for use by Linux kernel developers, as a replacement for it. Subversion was out of the question as centralized SCM, with lack of support (then) in core for merge tracking; this made it completely unsuitable for the largely distributed development model of Linux kernel. Bazaar was probably too slow (at least then), and a bit on centralized side (I guess).

Git is more powerfull (in my opinion), Mercurial is simpler (in people opinion) and a bit more portable (Python); Git is scriptable and is based on data model allowing independent reimplementations (see e.g. JGit, git written in Java), while Mercurial has Python bindings for writing extensions, and is based largely on API allowing change of underlying repository format (revlog - revlog-ng)... but that is just my supposition. They fill slightly different niches.

Besides isn't having a choice considered good thing? We have KDE and we have GNOME and XFCE (and other window managers and desktop envirionments); we have Emacs and Vim (and other programmer's editors); we have rpm-based (e.g. Fedora Core, Mandriva, SuSE) and deb-based (Debian, Ubuntu) and tgz-based (Slackware) and source-based (Gentoo) distributions; we have KWord, AbiWord and OpenOffice.org... and we have Git, Mercurial and Bazaar.

Jakub Narębski
Did not see your answer right away. +1. Although I would be careful with the "choice" argument. Especially when it comes to include KDE ;) ( http://linuxhaters.blogspot.com/2009/01/river-of-fail.html )
VonC
I don't see the final part of your answer (only up to "a bit on centralized side (I guess)"). If you don't see the last two paragraphs as well, all you need to do is to make a trivial edit, in order to restore the full content. See http://meta.stackoverflow.com/questions/12988/serverfault-cut-off-truncated-on-long-post.
VonC
@Vonc: Thanks for notifying about this. Fixed.
Jakub Narębski
+4  A: 

In my experience judging from the number of questions noticeably skews the comparision to git and against Mercurial. The reason is twofold:

  1. Have a look at hg update --help versus git checkout -h and git --help checkout. With Mercurial I seldomly found questions which aren’t answered by a few glances at hg help.

  2. http://mercurial.selenic.com/wiki — if you need help, you’ll likely find it there, including many Tipps and Tricks: http://mercurial.selenic.com/wiki/TipsAndTricks