Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rename default branch in TortoiseHG

Is it possible to rename 'default' to 'production' in TortoiseHG?

like image 250
Stan Avatar asked Apr 28 '11 21:04

Stan


2 Answers

You cannot rename a branch in Mercurial (or TortoiseHg for that matter). What you do instead is to start a new branch called production and base it on the current default branch.

You can do this in TortoiseHg 2.0, where you

  1. Click the row representing the working directory
  2. Click the branch button
  3. Click to open a new branch
  4. Fill in the branch name and click OK
  5. Enter a commit message and click Commit.

TortoiseHg commit dialog

This will create a new branch with the name production. The old default branch will remain and you can thus put new features there before merging them into production when they're stable.

like image 58
Martin Geisler Avatar answered Oct 13 '22 16:10

Martin Geisler


You cannot do it directly from the Tortoise2.0+ settings, but through the command-line hg.
As documented in hgbook:

Mercurial lets you assign a persistent name to a branch.
There always exists a branch named default. Even before you start naming branches yourself, you can find traces of the default branch if you look for them.

To start working with named branches, use the hg branches command

$ hg branch production
marked working directory as branch production
$ hg branch
production

Check then if that change is reflected in TortoiseHg

like image 20
VonC Avatar answered Oct 13 '22 18:10

VonC