Mercurial vs Git

November 16, 2008 by Doug Leave a reply »

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

Advertisement

11 Responses

  1. Jakub Narebski says:

    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 says:

    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 says:

    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 says:

    ridiculous post.

  5. web pixy says:

    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. Darius Damalakas says:

    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

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

  8. Maya Bailey says:

    I like both the Gamecube and Xbox, we have them in our home office and also in our living room.**.

Leave a Reply