Why I switched from Mercurial to Git

After a few month using Mercurial (see my blog post from a year ago Mercurial to replace SVN) I switched to Git.

I’ve always been tempted to use Git, since this Tech Talk by Linus Torvalds in May 3, 2007.
[iframe src=”http://www.youtube.com/embed/4XpnKHJAok8″ width=”420″ height=”315″]
I even tried it a few times, but Mercurial commands seem more familiar to a Subversion user, and at this time, Mercurial GUI was more user friendly.

But then half a year ago, I wanted to convert to Mercurial our SVN code base at work, which is something like 15 man-years of C++.
I used the Mercurial ConvertExtension. The process took hours, used a few gigabytes on disk, but failed after using too much memory.

This failure was a clear signal: I started with the Git – SVN Crash Course.
Git-logo

I used the git-svn clone command, which also took a few hours to run, but succeeded after a shorter time, only using 600 megabytes. This was not even twice the size of the SVN working copy, but with the full history of our project!

Since then, I started using git for all my private repositories: I converted losslessly my private repositories, thanks to the marvelous Hg-Git Mercurial plugin.

I also registered to GiHub, and discovered a whole new dimension to open-source development!
GitHub Logo

There I truly discovered the power of a typical open-source Git workflow: the way to clone (fork) a repository, to make a correction, and then to make a pull request, fully integrated in the issue tracker.

Now, I am beginning to use the hosting facilities of the GitHub Pages, and I must say that I am perfectly happy with their automatic Pages Generator that helps me advertise my open source work.

TortoiseGit-logo
And for the tools? GitHub help a lot creating, cloning and merging repositories. Under Linux I’ve become used to the good git command line. Under Windows, I am using the wonderful TortoiseGit GUI that I would recommend to you, at least to start.

Now I can tell you: if you try Git, and take the time to learn it subtleties, you will love it!

Mercurial to replace SVN

Mercurial Logo

For what I’ve seen in the last few month, it seems that Mercurial (Hg) is a Distributed Version Control System (DVCS, or Distributed Source Code Management) that is becoming to replace Subversion (SVN) in many Open Source projects… at least when Git is not already in the place !

While I am in it, Hg and Git have both been started on april 2005, shortly after the announcement that the free version of BitKeeper will be stopped.

Google Project and SourceForge are providing Mercurial as a choice of DVCS, and many tools are compatible with it. I’am using TortoiseHg, as I’ve used TortoiseSVN for many years now (in the same way, there is TortoiseGit).

For Android development, what I appreciate in Mercurial is that it does not cluster the working copy of my projects with “.svn” subdirectories like Subversion ! Instead, there is a single “.hg” directory, and this help a lot when working with Eclipse (no need to exclude explicitly “.svn” in the “src/” directory) as well as for performance/responsiveness!

I’ve quickly learned to use Mercurial with the famous “Hg Init” tutorial, which start by a “Subversion Reeducation“!

Here you can find some articles I’ve read about Hg and Git (and choosing among them) :

Please note that I did NOT really make a choice: I only started to use Hg because its used on some open source projects I am following!

Edit: for installation instruction, see Hg installation on a webserver (HgWebDirStepByStep) and in my case, installation for Debian 5.0. I use a simple “.htaccess” file to restrict access to my server.

Edit 2: please, have a look at my newer post Why I switched from Mercurial to Git