Branching in Mercurial (and in Git) Explained

There seems to be a little bit of confusion about just what branching methods exactly are supported by Mercurial and where the differences to Git are (at least, I was confused at first!). So this text tries to explain branching in Mercurial (and Git) in a bit more detail.

Short-term branching in Mercurial

Let's start with the branching model in Mercurial, since it is somewhat simpler. Consider three developers: Alice, Bob and Clark. Alice has started work on a new project, and Bob and Clark are to take part in the development. For the sake of simplicity, let's assume we are in a local network, and all three developers can pull changes from each other. Alice's repository looks currently like this:


CategoryHowTo