Git, Mercurial, or Bazaar? 9
The other big change I’m considering is actually moving away from Subversion. I’ve really enjoyed using it, but a recent discussion on the Groovy Dev list about Distributed Version Control Systems (DVCS) has got me looking at alternatives and why it would be good. I asked my friend Kate if she had any blog posts on why switching to a dvcs is a good idea and she whipped one up for me.
After reading through it I think I’m sold, but now I’m trying to figure out which one to try out first. Git honestly looks like the clear winner here in a number of respects:
- Serious mindshare amongst the OSS projects
- Has a great community committed to pushing the project forward (as Kate suggests )
- Has some really good functionality (even if it is a bit obtuse to get to understand)
- Looks like the beginnings of some plugins
But it also has some (current) drawbacks:
- Tools are really only available on Linux - Mac looks like its coming but could be a pain in the ass to build, forget Windows right now
- No IDEA plugin yet (bummer) - but it does look like IDEA 8 will support it
- No NetBeans plugin
- It’s a bit obtuse to learn - the commands are not necessarily the easiest to understand but they do have a Subversion -> Git guide online
So, I think I will try Git first, maybe. What about the other two - Bazaar and Mercurial? Bazaar honestly looks like 3rd place contender right now, but it does have some interesting tools available to it. Let’s look at Mercurial next.
- There are some pre-built packages for OS X and Windows - nice
- Again, looks like the beginnings of some plugins
Some current drawbacks
- Doesn’t seem to have the same mindshare as Git does (this is my perception not necessarily true)
Now onto Bazaar.
- Binaries available for multiple platforms - OS X, Windows, and Linux
- Patch Queue Manager - very interesting tool
- Bundle Buggy - another interesting tool
- There are again plugins available
Of course after I started this I found this much more in-depth review of the different systems over at InfoQ.
I think after reading a ton more on this (and the InfoQ article) that I’m going to give Mercurial a short first and see how it goes. Kate makes two more points at the end of this blog post on Mercurial vs. Git (which itself was a response to another blog post) - If you need Windows support or documentation are important items then Mercurial may be a better choice. For me, while I don’t need Windows support, it will be nice to understand what I’m trying to do first.
Trackbacks
Use the following link to trackback from your own site:
http://www.warneronstine.com/blog/articles/trackback/322

There are some prebuilt packages for Mac OSX available on the net. If you want to build it from source I'd suggest MacPorts which takes care of the dependencies.
Support for Windows is available by the mSysGit fork which is currently being merged back into the official version. Yet another possibility would be to use Cygwin.
UsabilityIt's true that Git installs a whole bunch of commands which can freak out most novices by the sheer enormity of their number.
However, in day-to-day work you will only use a few of them. These commands are called the porcellain while the other commands are called the plumbing. They can be quite handy for special cases when you want to do something unusual with your repository.
I strongly suggest that you read the docs before working with git as it's easy to shoot yourself in the foot when just playing around with those commands. Additionally, GitCast has really nice introductory screencasts for different aspects of Git.
AdvantagesGit has one definitive advantage over Mercurial: Branches. I know that the Mercurial guys just went on to define a repository to be a branch but having X directories/repositories for different versions of the same source is just wrong in my humble opinion.
P.S.: Your Markdown plugin doesn't seem to get the headers right in the preview.
I've been using Mercurial for a while now and it was a very smooth transition from SVN. The UI is very familiar and the commands map well. Mercurial is being used by some pretty large projects out there like OpenSolaris, NetBeans, Mozilla, MoinMoin and naturally seems to be pretty popular among the Python crowd.
Mercurial has its own patch queue manager : Mercurial Queue
Hi there.
I changed over from Subversion to Git about six months. The key to choosing Git over Hg or Bazaar was the uni-direction SVN support that is available in Git. Unfortunately Hg or Bz only support importing from an SVN whilst Git supports pulling and pushing.
I've ended up using Git as a branch management tool for SVN.
Downside is that Netbeans does not support Git yet although someone has started work on nbGit, by basing it on the Hg Netbeans plugin. nbGit is hoted on GitHub.
Best of luck with your migration.
i needed something that would work on both windows and linux so I went with mercurial. And it's been pretty smooth thus far. Setting up the web cgi for a central repo was pretty easy too.
out of the all the distributed scms's they all seem to be moving towards and identical set of features and cmd line syntax, so I think all 3 you list are a good option and dare I say somewhat compatible with each other.
Git is trivial to build on OS X and works without issue. The only thing that doesn't build easily is the help docs (they're asciidocs, which i think os x is missing pieces for). So, on os x none of the "git help foo" commands work (unless you've gone through a lot of hoops) , but it's not a big deal because they're all available online.
And on os x you can use GitNub, which looks like a cool graphical browsing tool.
"Git has one definitive advantage over Mercurial: Branches."
Well... Not really. That is, Git handles branches as part of a single repository, but that's far from a definitive advantage with a dvcs; I can have as many branches as I want, merge them in when I want, and generally not worry about managing them. Git wins here, but only a "feature check", not a "definitive advantage".
Git's bidirectional SVN support _is_ a definitive advantage. It's the right feature at the right time.
Mercurial's cross-platform speed, support, and ease of use (combined) give it a definitive advantage. I have _no_ choice but to use it at work.
Mercurial's atomic checkins are, I would say, a definitive advantage. Git, like CVS and SVN, thinks that part of the job of a VCS is to write ">>>>>>>" merge markers into my code and/or documentation. I think that makes a hard job (merging) even more annoying. Because of this my policy is to never run 'svn update' until after I've confirmed each incoming change. Mercurial makes that a total non-issue -- it's not even possible to screw up a merge (or a push) in this manner, because conflicts are handled by the version control system, NOT by the flat files contained in the version control system.
My summary: I'm very happy with Mercurial, but I'm eagerly waiting either for Git to mature enough to be useful on Windows, or for Mercurial to get mature bidirectional SVN support.
Hi,
I wonder, what functionality you're missing from the Mercurial plug-in. Could you give us a hint, so we can improve in this area?
In my opinion the plug-in now supports most features of Mercurial. If you haven't tried a version above 0.2.576, you've missed all the good stuff :-), as there have been quite a lot of fixes and additions to functionality since March 08.
Best regards, Bastian
I gave a presentation at my workplace last month on this topic. We do groovy/grails development, and most of the developers are comfortable with SVN, but don't have any prior experience with any sort of DVCS system.
Of the three, I prefer Mercurial over Git or Bazaar, though I think any one of the 3 is preferable to SVN. I think that for developers coming from subversion (who often don't fully understand the full set of commands available there) that it has the best balance of speed, ease of learning, and power of the 3 systems.