With mercurial it is easy to create a tag at a certain revision: hg tag -r <revision> <tag-name>
. But how to create a branch at a certain revision?
In order to create a Git branch from a commit, use the “git checkout” command with the “-b” option and specify the branch name as well as the commit to create your branch from. Alternatively, you can use the “git branch” command with the branch name and the commit SHA for the new branch.
The git branch command can be used to create a new branch. When you want to start a new feature, you create a new branch off main using git branch new_branch . Once created you can then use git checkout new_branch to switch to that branch.
Preface: Mercurial branches are two types:
In order to get named branch BRANCHNAME, starting at REV
hg update REV hg branch BRANCHNAME ... hg commit
commit is a must, because
the branch will not exist in the repository until the next commit
as noted in hg help branch
hg update REV ... hg commit
and current branch get additional head
hg push --new-branch
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With