Creating a Branch in Mercurial with TortoiseHG

Any project, no matter how small, can be improved by the use of source control.  I have settled on Mercurial (through TortoiseHG) for my source control needs.  I have generally been very happy and have taken frequent advantage of its ability to clone and branch cheaply.

Normally, when I wanted to work on a branch, I would clone a repository and work on the branch from that clone.  That is easy and straightforward in TortoiseHG, but today I wanted to create a branch using my existing repository.  Fortunately, manually creating a branch is also straightforward in TortoiseHG (if not obvious).

To manually create a new branch, simply make changes as normal on the existing repository.  When you are ready to commit, look for the “Branch: ****” button on the top toolbar of the commit window:

TortoiseHg-Commit 

Pressing it will bring up a windows with several branch options:

TortoiseHg-NewBranch

Select the “Open a new named branch” option and give it a name.   Then commit your changes as normal.

The new branch will be created and your changes committed to it.  You will now work on the new branch by default.