Mercurial sets branch as new default branch

As a result, I will need the code to be in the latest revision of the branch, which is not the default branch, when cloning the repository, without the need to do "hg update mybranchname". Is it possible?

+7
source share
3 answers

The advice so far has been this: you should always use default as the main branch , as Mercurial will check default if it finds it in the repository.

This will change a bit with Mercurial 2.1: now you can close the default branch (if any) and add a bookmark named default in its place. The new clone will retrieve the bookmark and update it, effectively switching to another branch of the process.

Please note that your responsibility to save the default bookmark points to the branch of the branch you want to check, so this is not 100% proof of a fool.

+8
source

You can merge a branch into a default branch, for example:

 hg merge mybranchname hg commit 

Now the branch is the main branch. You can hide the old branch with:

 hg update mybranchname hg commit --close-branch 
+1
source

By default, the default branch is not "default", but a branch from the top.

Just copy before cloning to any existing branch.

0
source

All Articles