In the debate between Mercurial and Git, I’ve long held the side of Mercurial. This is mostly due to the fact that Mercurial’s commands are far easier to understand, but I’ve also liked the fact that Mercurial doesn’t encourage rewriting a repository’s history as much as Git does. This has encouraged me to seek to use Mercurial as my favored DVCS, but that’s now changing.
Mercurial has a tremendous advantage in that it’s command structure is easier to understand. I’ve enjoyed this feature having come from SVN, and every time I have to use Git, it makes me want to scream (and has literally made me do so one a few occasions). The usability of the command line is severely relegated when one starts to use tooling present in IDEs, file browsers, and other UIs. In this case, one needs only to go to the command line for very advance operations, in which case both DVCSs require looking up the command structure to understand how to accomplish the task.
So, how does the tooling compare? I primarily use Eclipse for my development, but I also sometimes use Xcode. I was told by an Eclipse committer, well over a year ago, that the tooling in Eclipse is better for Mercurial than it is for Git, but the Eclipse Foundation had elected to switch to Git (from CVS). I wasn’t actually using either but I didn’t like Git at the time (since using it nearly always required the command line). Lately, at work, we’ve been using Git more and more, mostly due to Eclipse using it. As a result, I’ve become familiar with the tooling in Eclipse. Today I decided that I was going to convert one of my Eclipse-based projects from SVN to a DVCS. I tried out the Mercurial tooling and found it significantly lacking. I decided, that despite the difficulty in the command line, Git would be a better choice since it has less difficulty in the tooling. Lastly, with Xcode, Git is built-in where as Mercurial is not.
So, where does this leave the Mercurial v. Git debate? It looks like Git is going to end up being the clear winner, simply for the fact that Git appears to have better tooling for developers. Git’s command line for basic functionality is atrocious (“git reset –hard HEAD .” vs. “hg revert .” anyone?), but in the presence of good tooling in the IDE, the basic functionality accessing a menu item. Additionally, Git’s shortcomings in the command line can be partially mitigated with aliases (I’ve already made one for revert), though this still doesn’t solve the confusion between fetch and pull. So, with a good GUI to cover up the lousy CLI, Git has finally become a viable alternative in my mind.
PS. For those wanting a laugh, read Git is MacGyver / Mercurial is James Bond (Ok, that’s not really the title but it should have been).