How to only push to one branch in Hg?

后端 未结 3 1442
梦谈多话
梦谈多话 2021-01-30 05:21

I have a Hg repo with 3 branches in it, but two of them are inactive (since I have already merged them into my default branch). hg heads shows 3 heads, one for each bra

3条回答
  •  孤街浪徒
    2021-01-30 05:34

    You can FORCE it!

    Here is how:

    1. Pull from your repository
    2. hg push --rev nnn -f (replace nnn with your Rev # of your working branch)
    3. do NOT force before PULLing. if you do things will get out sync and you are screwed
    

    If you are using something like RhodeCode then check it out after forcing it and you will see that your latest branch is there.

    However I think that later on Mercurial is going to ask you to push the other branch again, even if you close it, Mercurial will try to create that branch on a server.

    I'm a Git user also and ran into the same situation because a customer is using Mercurial but I would like to use Git workflow style.

    I think it is doable but I have not figured out 100% yet.

提交回复
热议问题