It has been a few years since I’ve learned about DVCS (Distributed Version Control Software), and there are always some battles between the three main containders. The Centralized VCS war was won by Subversion, but the DVCS is far from over. I had the chance to use those three tools for work, free-time and open source projects. I do not claim that my time using them is enough to have a solid conclusion, but for me, there is a clear winner.
Bazaar was the first DVCS I’ve tried. It has a Window integration, as well as several standalone GUI. Integration in Eclipse is rudimentary at best last time I checked.
For Bazaar, each repository can only have one branch. So when you are working on different things, you must have as many local checkouts as your features. Not very efficient when you have several tickets assigned to you on different versions of a product.
Nevertheless, was a good start at understanding a DVCS. I suppose it will never get the momentum of git or Mercurial because of some limitations (branches but also the different repository model changes).
Git is the latest DVCS I’ve tried for different scikits (learn and optimization). The default GUI available on Linux is something based on Tk, but it’s not very usable (I didn’t find a way of saying that I want to include some changes and not others). I never tried Git for Aclipse, but I suppose it may be better.
When you pull changes from a remote repository, you can’t get everything, especially if your local repository is not a fork of this peculiar repository. You have to checkout the branch you want to pull and then pull it. Then, it will not be directly visible, and if you have local changes, you have to merge the remote branch inside your repository. Indeed, Git does not allow several branches inside one branch.
Git allows you to “cherry-pick” changesets to apply them somewhere else. It’s a nice feature, I prefer the bundle one. I’ve used it with Mercurial, ut’s especially useful if you can’t have access to the main repository. With contractors, this happens all the time, so you send the repository to your contractor, they make some changes, and bundle them in one small file that they send you. You can then pull it inside your repository.
Git can also do N-way merges. You take several branches or repository and you can merge everything in one click. I don’t find this very smart, because you won’t be able to find which merge was problematic if everything fallas apart. I’ve already seen havoc happen in several 2-way merges, I was glad to be able to find the guilty changeset/merge.
Mercurial is the second DVCS I’ve tried, this time only for my work. I’ve never used bitbucket, but it seems very neat. There also several GUIs, for only exploring the repository like hgview (very cool BTW) or for integration inside Eclipse (Mercurial Eclipse does a really good every-day job for me).
I tried MErcurial because it allows you to change the current branch you’re working with, and also you can have several heads for your branch (they are called unnamed branches I think). Although this adds a level of complecity, I don’t always want to create a new branch for a small task (like I’ve created a branch for my contractors, but I’ve added some modifications to their code, I won’t create a new branch for that), but I want to keep things in separate branches.
Mercurial can also create bundles, the only drawback is that you may do see what is inside aside for hg incoming, but it will only display what is only available in the bundle, it’s not near enough (I don’t know if git is capable of doing this). It seems to be possible to cherry-pick changset, but I never had to do this.
A few days ago, I really had troubles with git, troubles I would not have with Mercurial. I tried to pull changes, but I could get them inside my master. No error messages, nothing. With Mercurial, I would have got 2 heads, and I would have merged them afterwards (there is a fetch command to pull and merge, but you seriously don’t want to do that with code you don’t know).
IMHO, Git is very powerful, but also too powerful. It allows you to do anything, and you have to keep in mind that you have all this power and that you may bring doom to your project. With Mercurial, it’s far more simple and a command does what is expected to do (hg pull pulls all changsets from a remote repository inside yours, git doesn’t do that). You may see some pages on the Internet about features Mercurial lacks, but with a standard DVCS workflow, nothing is missing.
Will Git win the DVCS war? I don’t think so. In fact, there may never be a clear winner. Git will be the favorite tool for hackers, but developers like me will favor Mercurial. Perhaps the main point is more that github has some nice features that bitbucket may (or not) lack? Yesterday, I talked with a colleague of mine about SVN, Git and Mercurial. We agreed on Mercurial as an efficient and easy-to-use VCS.
Some additional links I do not always agree with (some rants are just a workflow issue they have on their own project):