Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Correct way to jump back and forth between two branches?

If I create a branch:

hg branch branch-A

and commit to it:

hg commit -m "improvement A-1"

and then create a second branch:

hg branch branch-B

and commit to it:

hg commit -m "improvement B-1"

If I want to add my next change to branch-A do I simply type:

hg branch branch-A

and commit to it as before:

hg commit -m "improvement A-2"
like image 307
uzo Avatar asked Sep 21 '09 15:09

uzo


1 Answers

hg branch

always creates a branch (although it warns you if the branch already exists.) To switch to an existing branch, either

hg update -r <some revision in that branch>

or

hg update <that branch>

will switch to that branch.

like image 197
David Winslow Avatar answered Oct 09 '22 01:10

David Winslow