Git, Mercurial and Bazaar – A Comparison

Open-source Version Control Systems have come a long way since the days of CVS. SVN, one of the most successful VCS to be ever used,  is now loosing its ground to a new genre of VCS known as DVCS or Distributed Version Control Systems. A DVCS or Distributed Version Control System is a version control software where each working copy contains the full history of all the revisions, thereby making it a fully functional code-base repository and a remote backup to the original code-base. With the increasing size of teams working on the same code-base, the need for DVCS was apparent. We are going to compare the three most popular open-source DVCSs – i.e. Git, Mercurial and Bazaar.

Some early DVCS were BitKeeper and Monotone. The Linux Project can be credited for the creation of two of the most popular DVCSs, i.e. GIT and Mercurial. The Ubuntu development group later joined in by the creation of Bazaar.

Git was created after BitKeeper, the original Linux Kernel DVCS, decided to restrict its licensing. It was created by Linus Torvalds himself and targeted at high performance and an extensive set of advanced features. As a mater of fact,  another very popular Open-source DVCS called Mercurial was created because of BitMover’s (company behind BitKeeper) decision to remove the free version. Mercurial was written in python. It was initially meant to run only on Linux  but was later ported to Windows. The Ubuntu community with the backing to Canonical Limited, created their own DVCS called Bazaar. It was later Open-sourced along with the LaunchPad platform for hosting repositories.

Let us see some of the similarities among the three

  1. The License: Not to forget! The most important thing while considering the use of any software is “the License”. Git, Mercurial and Bazaar are all licensed under the GPL.
  2. Support for Atomic Commits: It is an operation in which a set of distinct changes is applied as a single operation and when the changes are applied the atomic commit is said to have succeeded. All of Git, Mercurial and Bazaar support this vital feature.
  3. Support for Symbolic Links: All the three have support for symbolic links
  4. Pre and Post event hooks: All of them support Pre and Post event hooks making them extremely useful in staging and deployment scenarios.
  5. Merge Tracking: The three of them support Merge Tracking
  6. Revision Tags: All of them have support for Revision Tags
  7. RCS Keywords: Git, Mercurial and Bazaar have support for standard Revision Control System Keywords
  8. Interactive commits: Interactive commits allow the user to cherry-pick the patch-hunks that become part of a commit, instead of having only a file-level granularity. All of the three support Interactive commits.
  9. External References: The three allow embedding of foreign repositories in the source tree, i.e. support for external reference.

Now for the differences in the three:

  1. Basic Binaries Structure: Git, the most powerful of the three, is more of a tool-set (git-pull, git-merge, git-checkout etc which form the git-core) than a single binary which supports DVCS commands, where as Bazaar and Mercurial are single monolith binaries with command arguments performing various DVCS actions.
  2. Ease of Use: For a beginner who is new to Version Controls Git will definitely seem much more confusing than the other two, and one has to go through all the VCS jargon like merging, branching, tagging etc to have a grip over Git. On the other hand Mercurial and Bazaar are quiet easy to catchup and understand. Although both have advanced features, they are neatly abstracted under a simpler command structure.
  3. Power to the User: Git seems to be the most powerful out of the three in-terms of the flawless set of features it provides. The very reason why some of the biggest projects like to use Git. In-fact Git was designed to be powerful.
  4. Performance: In terms of raw performance, Git leads almost all benchmarks followed by Mercurial and then by Bazaar. A detailed benchmark can be found here.
  5. Final Repository Size: Again Git stores wins here, with the least size of the Final Repository. It is followed by Bazaar and then by Mercurial. Reference: GitBenchMarks
  6. Network Protocols Supported: Git has support for 3 protocols HTTP/HTTPS, SSH and the GIT protocol. Mercurial supports 2 of them HTTP/HTTPS or SSH.  Bazaar supports HTTP/HTTPS and SSH by default, but with plugins it can also support SFTP and RSYNC protocols.
  7. Design Differences: Mercurial and Bazaar are FILE LEVEL VCS as they store versions of files but GIT is a CONTENT LEVEL VCS i.e.  it stores delta of content, not the file itself: two files with the same content will be stored only once.
  8. Repository Hosting: For open-source and private repository hosting both Mercurial and Git are way ahead of Bazaar in-terms of number of Source code hosting providers available. When there are more than 9 hosting providers for Mercurial and about 8 hosting providers for Git, only 3 hosting providers are available for Bazaar.
  9. Usage by Popular Open-source Projects: When there are about 11 popular Open-source projects which are version controlled by Bazaar, there are about 29 popular projects which use Mercurial as a VCS and more than 65 popular projects which use Git as their Source Control.
  10. Free Private Repository Hosting: For coders looking to host their private projects for free, Mercurial has BitBucket which provides a whopping 1GB for hosting single Private repository. for Git there is Unfuddle which provides 200 MB for a single project with multiple repository support.  Git also has ProjectLocker which provides about 500 MB space for unlimited repositories though with a messy Web UI. I couldn’t find any similar service providers for Bazaar though.

The Conclusion: If you are a big group of professional coders working on a huge project with lots of moving parts Git is the best open-source DVCS out their for you guys, but if your team has trainees and noobs then Mercurial or Bazaar is what you should go for. Again if you are working on a project closely related to the Ubuntu project launchpad should be your platform and Bazaar should be your DVCS.

This entry was posted in Comparisons and tagged , , , , , , , , , , , , , , , , , , . Bookmark the permalink.

22 Responses to Git, Mercurial and Bazaar – A Comparison

  1. Pingback: Tweets that mention Git, Mercurial and Bazaar – A Comparison | TechTatva -- Topsy.com

  2. Michael Munsey says:

    According to the link, Mercurial has better performance than Bazaar in almost all categories.

    • techtatva says:

      I guess point 4 and 5 got mixed up. Thanks for pointing out the error. Its corrected now.

      Regards,
      The TechTatva Team

  3. Pierre says:

    Are you really sure Git stores delta of content ? To my knowledge it stores blob which are content of file without the metadata associated with it.

    • techtatva says:

      Yes it stores the Blob Objects which are the content of the file without the metadata. Git only tracks contents at a whole tree-level. All the changes to the tree (additions, deletes, renames, edits etc) are implicitly encoded in the delta between the two states of the tree; you just track what is the content.

      The same has been discussed in detail here: http://stackoverflow.com/questions/612580/how-does-git-solve-the-merging-problem/612747#612747

    • Jakub Narębski says:

      Git uses (binary) deltas in packed format, but this is backend issue: on the level of API “blob” objects represent contents of file; the relevant metadata (filename, executable bit etc.) are stored in appropriate “tree” object representing directory.

  4. ralph says:

    When I first tried using git, it was very confusing and I hated it. Then I started using github, and I’m now officially hooked on git.

    Github made my introduction to Git a lot smoother by way of useful, pervasive documentation (how to import from SVN, add remotes, push, pull, merge, etc) and a friendly interface. I don’t bother with TortoiseGit or other GUIs because Github obsoletes them.

    Now having used git a while, I don’t really feel the need to check out mercurial or bazaar – git does everything I need. And picking up bazaar or mercurial is probably much easier now that I can feel my way around git.

    Thanks for the article and best wishes

  5. Jakub Narębski says:

    You have history a bit mixed up (or just a bit unclear for me): both Git (by Linus Torvalds) and Mercurial (by Matt Mackall) were created nearly concurrently in response to so called “BitKeeper fiasco” (see e.g. http://better-scm.berlios.de/bk/demise-of-gratis-bitkeeper.html). Note that though Mercurial is written mainly in Python, it contains some code in C for better performance.

    Bazaar (formerly Bazaar-NG) was AFAIK open source from the very beginning; it is only Launchpad that was closed-source and open-sourced (AGPLv3) only lately.

    • techtatva says:

      You are absolutely correct. “Git was created after BitKeeper, the original Linux Kernel DVCS, decided to restrict its licensing. It was created by Linus Torvalds himself and targeted at high performance and an extensive set of advanced features. As a mater of fact, another very popular Open-source DVCS called Mercurial was created because of BitMover’s (company behind BitKeeper) decision to remove the free version. Mercurial was written in python. “. This is that part I am trying to communicate the exact same points you are mentioning.

      The time-frame when both Git and Mercurial were created was almost the same as a matter of fact Mercurial was also created to work as the DVCS for Linux. (http://en.wikipedia.org/wiki/Mercurial#cite_ref-announced_0-1)

      You are also correct regarding Bazaar and Bazaar-NG. It was open-sourced in 2005 before which they had a primitive ancestor known as Baz.

    • techtatva says:

      If platform support is considered then both Mercurial and Bazaar are ahead of Git may be that is because the Git community is not very interested in porting to several platforms. As a matter of fact most OSS using Git are for Linux or are platform agnostic. Yes there is msysgit which can run Git on Windows also http://code.google.com/p/msysgit/.

  6. Pingback: 版本管理系統的戰國時代 | bossliaw

  7. It’s appropriate time to make a few plans for the longer term and it is time to be happy. I’ve read this publish and if I could I want to recommend you some attention-grabbing issues or suggestions. Perhaps you can write next articles referring to this article. I want to read more things about it!

  8. Carrol says:

    Nettles nourish your energy at the deepest possible levels with intense supplies of iron, chlorophyll, and copper

  9. Krystyna says:

    I see a lot of interesting articles on your blog. You have to spend a lot of time writing, i know
    how to save you a lot of time, there is a tool that creates unique, SEO friendly articles in couple of minutes, just search in google –
    k2 unlimited content

  10. Eleanor says:

    Finally i quit my regular job, now i earn decent money on-line you should try too, just type in google – bluehand roulette
    system

  11. Pingback: Searching for Code through IDE, Black Duck Code Sight & Koders « Dove Traduco le Cose

  12. Roman says:

    I read a lot of interesting posts here. Probably you spend a lot of time writing, i
    know how to save you a lot of time, there is an online tool that creates readable, SEO
    friendly articles in seconds, just search in google
    - laranitas free content

  13. Pingback: How to: What is the Difference Between Mercurial and Git? | SevenNet

  14. Pingback: Solution: What is the Difference Between Mercurial and Git? #dev #it #computers | Technical information for you

  15. Pingback: Fixed What is the Difference Between Mercurial and Git? #dev #it #asnwer | Good Answer

Leave a Reply

Your email address will not be published. Required fields are marked *