Why I like distributed source control

This post is more than 13 years old.

Posted at 08:00 on 16 September 2010

Some people wonder why I’m such a fan of distributed version control in general and Mercurial in particular. Here’s why.

  • I love being able to branch my code freely, at will, as often as I need to.
  • I love having both short single-revision ad-hoc branches and longer six-to-eight-week branches so I can work on more complex tasks in parallel with weekly sprints.
  • I love being able to create branches off other branches if necessary, not just off trunk.
  • I love being able to merge them easily and reliably.
  • In seconds.
  • No matter where they’ve been branched from.
  • Or how often they’ve been merged before.
  • I love having complete confidence that even if the merge does go wrong, I can quickly and easily roll back and try again.
  • Even if I’ve pushed the broken merge to the central server.
  • I love being able to see at a glance, exactly what I’ve merged, where it was branched from, and when.
  • I love being able to detach a branch, or a part of a branch, and reattach it to trunk as an alternative to merging in order to keep my project’s history easy to follow.
  • I love being able to pass branches across the LAN to co-workers for review or brainstorming before integrating them into production.
  • I love being able to draft and edit my commits as a series of patches on my local machine and commit them as a batch when they’re ready.
  • I love being able to quickly drill down through my revisions to find the one that introduced a bug.
  • I love not having to waste time on ugly, time-consuming hacks, error-prone workarounds, or restrictive, unnecessary policies to do any of the above.
  • I love being more agile and more productive.
  • I love it when other developers are able to do the same, regardless of experience.
  • I love having a source control system that Just Works.

Mercurial allows me to do all of the above, and much more, without breaking a sweat. With the (debatable) exception of the first two, Subversion does not allow me to do any of them.