when 140 characters is not enough

Mercurial has cheaper branching than git. There, I said it.

There are several ways to branch in Mercurial:

The slowest, safest way is to just make a new clone of the repo. You can do this with git too. I don't like doing this, but some people do.

The next way is to use a bookmark. This is pretty much equivalent to git's branching. You'd use 'hg bookmark myfeature' and you get a bookmark (essentially a tag) that moves as you commit. It will point to the head of your new branch, just like a ref in git. You can delete it when you're done. The only difference here is that the bookmark doesn't get pushed/pulled, though there are plans to add this in 1.4.

The third way is to use Mercurial's "named branches." Some people like this (myself included), some people don't. There is no git equivalent.

They work kind of like bookmarks except that every commit on a named branch has the branch name as part of its metadata. This lets you see what branch a commit was made on without having to follow it up to the head.

I like this, some people find it clutters things too much. You can specify the name of a branch with any command and it's shorthand for "the tip revision of this branch" (i.e. it acts like a bookmark/ref).

The last method, and the method that is cheaper than git, is to just update to any revision you want and commit. You don't have to think up a name for it or do anything else -- just update and commit.

Git has no real way to handle this. Sure, it lets you update and commit, but if you don't create a (named) ref to that new commit you're never going to find it again once you switch to another one unless you feel like grep'ing through a bunch of log output. Oh, and hopefully it doesn't get garbage collected.

Sometimes I don't want to think up a name for a quick-fix branch. With git I have to name it if I want to really do anything with it, with Mercurial I don't. Sometimes I want to have the branch name as part of the commit's metadata. With git I can't, with Mercurial I can. Mercurial's branching is more flexible than git's, not less.

Aside from that, the other big difference is that by default Mercurial will try to push all branches whereas git will only try to push the current one. You can tell Mercurial to push just one branch, and you can (maybe?) tell git to push all of them. I guess this difference boils down to personal preference.

384 days ago : 1955 hits