Mercurial vs Git

Personally I’m more a fan of Mercurial with the main reason being: Portability.

As far as I know Git still has problems handling Windows which is something Mercurial has never had to worry about.  So I can switch between multiple different environments without worrying about my SCM falling down.

Another reason is the name and the command: hg vs git.  Hg sounds better than git.  It looks better.  Its less to type.

But its not about me or my bias – its about cold hard facts so here they are:

Git

Pros Cons
  • Lots of features
  • More hosting options.
  • Faster – slightly.
  • GitHub.
  • Solid local branch support.
  • Poor Windows support
  • Rubbish logo
  • Silly, long SHA1 hash of revisions.
  • You need to keep ‘packing’ the repo
  • History fiddling.

Mercurial

Pros Cons
  • Portable
  • Its built with Python
  • Easily extensible using Python
  • Cool logo
  • Better documentation.
  • Local integer revision numbers on top of the SHA1
  • No need to keep packing/optimising.
  • Smaller repo footprint.
  • Better patch support (bundles and such)
  • Easy to learn.
  • Smaller feature set.
  • Few 3rd party hosting options.
  • Fewer 3rd party apps and plugins.
  • Smaller community.
  • Slower development.

Who Uses What

Mercurial Git
  • Mozilla
  • OpenSolaris
  • Aptitude
  • Netbeans
  • Dovecot
  • Linux Kernel
  • Google Android
  • Beryl
  • Fedora

Who Needs What

Mercurial is great for people who want to dive into distributed version control and get busy.  Its clean, fast and easy to learn.  With a small footprint and single binary its the Zen of DVCS.

Git is for monstrous geeks and crack whores who like to wrestle with their tools before settling into using them.  If you never use Windows and really really wanna use GitHub like all the cool kids then use Git.

Discuss?

I’m always open to feedback – as long as you agree with me.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Google Bookmarks
  • BlinkList
  • DZone
  • Live
  • Ma.gnolia
  • Reddit
  • Slashdot
  • SphereIt
  • StumbleUpon

Related posts:

  1. Git and Mercurial Hosting
  2. …but Mercurial is even better
  3. 10 Free SVN & Project Hosting Services
  4. Your To-Learn List?

11 Comments to “Mercurial vs Git”

  1. Jakub Narebski 17 November 2008 at 1:45 am #

    I admit that I am bit biased towards Git, but there are a few things that you got wrong.

    Git Cons:
    * you don’t need to use full sha-1 of revisions, you usually use (when working) transient backward revision numbers i.e. counting from most recent version like HEAD^, or master~4 i.e. the result of git-name-rev; or (when referring to revisions) shortened to 7-8 characters sha1 or descriptions such like v1.6.0.4-736-g0f044d7 i.e. the result of git-describe
    * the need to repack from time to time is greatly reduced in modern git, and you have “git gc –auto” which you can put in crontab or its equivalent.
    * “History fiddling” or rather “History rewriting” is a Pro, not Con; you don’t _need_ to rewrite history, but the tools are there if required.

    Mercurial Pros:
    * Its built with Python… and C. Some core features are in C for performance, IIRC.
    * Smaller repo footprint…. benchmark? Because DVCS Comparison blog doesn’t agree
    * Local integer revision numbers… but they are local.
    * Better patch support (bundles and such)… better in what? Git has git-format-patch / git-am combo for sending patches for review by email, and git-bundle (admittedly inspired by Mercurial) for off-line transport (including mail)

    Mercurial Cons (not included):
    * getting tags almost totally wrong
    * local branches as afterthought (and thus not well done)

    Who Uses What: you listed one more project for Mercurial than for Git, not listing some of very important projects like WINE, Samba, Ruby on Rails or X.Org / Freedesktop, VLC or Prototype which use Git.

  2. Rich 17 November 2008 at 12:16 pm #

    I think msysgit (http://code.google.com/p/msysgit/) makes git pretty usable on windows now. Like the person said above you can use short hand like HEAD^ and IIRC you can get away with just using the first 4 characters of the SHA1 hash.

    I’ve found I don’t have to pack git that often, just happen to do it now and then when I remember.

    I’d have github down as a big pro too, it’s fantastic for getting lots of different takes on a project, great for forking a project doing a bit of work and then sending requests to people to take a look :) .

    I found Mercurial’s branching a real letdown the last time I used it, didn’t feel solid at all and basically seemed to make it un-usable for myself, as I use branching quite a lot but each to their own.

  3. bandi 18 November 2008 at 12:05 pm #

    You forgot to mention git’s killer feature, the index (see for example http://codemac.net/blog/18/). I find myself using it from time to time.

  4. dmilith 18 November 2008 at 12:29 pm #

    ridiculous post.

  5. web pixy 18 November 2008 at 12:51 pm #

    You’ve made quite good comparison between Git and Mercurial but it’s not exactly objective. Anyway, the post is informative for people that don’t know much about them.

  6. [...] mentioned in a previous post about Mercurial integrations being fewer but I thought I’d actually put together a list of the decent [...]

  7. [...] a preferir uma ferramenta a outra varia desde a identificação com a filosofia do projeto até a preferência pelo logotipo do projeto. De qualquer modo, uma tendência clara da equipe por uma ferramenta específica deve ser pesado na [...]

  8. [...] Mercurial vrs Git LOL nunca había visto que tomaran en cuenta el logo LOL http://www.straw-dogs.co.uk/11/16/mercurial-vs-git/ [...]

  9. Darius Damalakas 7 March 2010 at 11:33 am #

    Post is very subjective, not informative.

    P.s. Whole OpenOffice is now on mercurial too, and google code and CodePlex offer mercurial support. No git support, however.

    There is also bitbucket, something like github, but not that mature

  10. Kylie Sanchez 30 June 2010 at 7:52 am #

    i love to play all day on my gamecube. *,*

  11. [...] you it is worth the trouble. If you ever find yourself loosing faith, take solace in a quote from this Git vs. Mercurial post: Git is for monstrous geeks … who like to wrestle with their tools before settling into using [...]