Mercurial: Can I rename a branch?

KevDog picture KevDog · Dec 7, 2010 · Viewed 62.1k times · Source

We now have a "stiging" branch, where "staging" seems to be a far better semantic fit. What's a good strategy for handling this?

Answer

Elliot Cameron picture Elliot Cameron · Aug 30, 2011

Update to the stiging branch and create a new branch off of it. Then close the old branch.

In summary:

hg update stiging
hg branch staging
hg commit -m"Changing stiging branch to staging."
hg update stiging
hg commit --close-branch -m"This was a typo; use staging instead."
hg push --new-branch