Branch key Mercurial

We have a vault with three branches, I wanted to clone one of the branches. Is there such a mercantile team? If I provide the path (branches) with the hg clone, I get 404 error.

+37
branch clone mercurial
Dec 28 2018-10-28
source share
5 answers

hg clone http://your/repo -r branchname should do the trick.

+85
Dec 28 '10 at 15:50
source share
β€” -

Benjamin is right. But is this really what you want to do? In particular, you will receive only the set of changes necessary to compose this branch, and nothing more - and this, for example, would prevent you from dragging the set of changes from the trunk or other branches. Perhaps you better just clone the entire repository, and then just work in the branch you are interested in; this will allow you to synchronize your repository with the one you can easily handle.

+13
Dec 28 '10 at 15:56
source share

hg clone <URL> -b BRANCHNAME clone of one branch, as requested

+9
Apr 12 '13 at 17:41
source share

I know this post is very old, but I had the same question. I found this trick:

 hg clone /path/to/your/repo -r 0 hg pull -u -b branchname 
+3
Apr 12 '13 at 15:58
source share

I am using Mercurial-4.0.2. In this case, we can specify the name of the branch by adding the branch name with the # symbol in the URL of the clone.

eg.

 hg clone https://user@cloneurl/my_product#MY_BRANCH hg clone --verbose https://user@cloneurl/my_product#MY_BRANCH "C:\myCode" 
+2
Feb 28 '17 at 7:10
source share



All Articles