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
- 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.
- 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.
- Support for Symbolic Links: All the three have support for symbolic links
- Pre and Post event hooks: All of them support Pre and Post event hooks making them extremely useful in staging and deployment scenarios.
- Merge Tracking: The three of them support Merge Tracking
- Revision Tags: All of them have support for Revision Tags
- RCS Keywords: Git, Mercurial and Bazaar have support for standard Revision Control System Keywords
- 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.
- 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:
- 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.
- 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.
- 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.
- 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.
- 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
- 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.
- 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.
- 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.
- 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.
- 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.