Make another branch default?

后端 未结 4 528
萌比男神i
萌比男神i 2020-12-25 12:20

I have a Mercurial repo at Bitbucket and on my local machine, both are mirrors, up to date. I created a feature branch, reflected in both repos. I did all my work in the fea

4条回答
  •  感动是毒
    2020-12-25 12:57

    Just merge feature-branch into default then close feature-branch:

    $ hg checkout default
    $ hg merge feature-branch
    $ hg commit
    $ hg checkout feature-branch
    $ hg commit --close-branch
    

    There is no more clean and sensible way (that I'm aware of) to “make feature-branch the default”.

    One thing that wouldn't be as nice, but you could do, is to make a commit to default on top of feature-branch:

    $ hg checkout feature-branch
    $ hg branch default
    $ hg commit
    

    But this would leave two heads in the default branch, which is suboptimal.

提交回复
热议问题