Going by the number of questions on this site for these three distributed version control systems, it seems like Git either
- is more popular, or
- is more difficult (hence requiring more questions), or
- 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:
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.
Brief comment, mid-2011:
Can we just call Git the winner? :)
No, I accept the argument that number of questions is not equivalent to popularity. Numbers sure are strong, though.
Code to reproduce the above plot:
import datetime as dt
import matplotlib.pyplot as plt
dates = [
"01/06/2009",
"01/07/2010",
"01/07/2011",
"01/07/2012",
"01/07/2013",
"01/07/2014",
"01/07/2015",
"01/07/2016",
"01/06/2017",
"28/08/2018",
]
x = [dt.datetime.strptime(d, "%d/%m/%Y").date() for d in dates]
git = [726, 3725, 9225, 17523, 27862, 41478, 55315, 71056, 86958, 102362]
svn = [2353, 5323, 9028, 12687, 15587, 18846, 21209, 23037, 24692, 25525]
mercurial = [169, 1120, 2765, 4221, 5230, 6030, 6651, 7134, 7524, 7765]
bazaar = [50, 159, 252, 351, 425, 483, 506, 525, 534, 539]
ax = plt.gca()
ax.grid()
plt.plot(x, git, label="[git]")
plt.plot(x, svn, label="[svn]")
plt.plot(x, mercurial, label="[mercurial]")
plt.plot(x, bazaar, label="[bazaar]")
plt.gcf().autofmt_xdate()
plt.ylim(0)
plt.legend()
# plt.show()
plt.savefig("comparison.png", transparent=True, bbox_inches="tight")
Canonical (Ubuntu) tracks software package usage for their distro, so there's no need to rely on Stack Exchange issue counts to measure popularity. However, as others have pointed out, this only tracks Ubuntu users and Canonical (Ubuntu) uses and recommends bzr (sample bias). Nonetheless...
The decline in votes for the git-core package makes me think I've done something wrong like
grep
ed the wrong package name from the ubuntu popularity table. Or maybe even this "vote" count is related to installations and not actual usage of the software.Here's some historical data for trending. I used the
<install>
rather than<vote>
stats from Ubuntu in this table, but it shows a growth spurt in Bazaar and Mercurial starting in 2011. Nonetheless,bzr
was behindgit
in 2011, but the recent stats for 2011 show that it passedgit
in total installed instances (on Ubuntu).Discalaimer: I used bzr on Ubuntu until 2012 when I worked on teams that used
git
exclusively.Bzr
plays nice with all other VCSes, allowing you to use consistent, intuitive bzr command line syntax. My switch togit
was for social rather than technical reasons.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.
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.
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.
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.
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.
[NOTE: With the release of Subversion 1.7, the first paragraph in my answer below is out of date, as Subversion now just creates a single ".svn" folder in the base folder, similar to the others now.]
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.
I use and recommend mercurial
Check the following link to a poll on the subject:
http://www.debian-administration.org/polls/160