Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

Mercurial: Switching to a Branch

📅 2010-Apr-13 ⬩ ✍️ Ashwin Nanjappa ⬩ 📚 Archive

To switch the working set of a Mercurial repository to a branch use the hg update command:

$ hg update BRANCH_FOOBAR

The only time I really use this is after cloning a Mercurial repository. After a clone the working set of the repository is always set to the default branch. I need to switch to work on a different branch. To view the available branches in a Mecurial repository use:

$ hg branches