Can I mark a branch as 'not going to push'?

后端 未结 3 1483
清酒与你
清酒与你 2021-02-03 20:23

I use named branches in Mercurial.

In doing so I have created one branch called playground where I can try out various wacky experiments. I never intend to merge this b

3条回答
  •  伪装坚强ぢ
    2021-02-03 20:56

    Starting with Mercurial 2.1 (released in February 2012), you can mark your changesets secret to keep them from being pushed to another repository. You use the new hg phase command to do this:

    $ hg phase --force --secret .
    

    This mark the current working directory parent revision (.) as being in the secret phase. Secret changesets are local to your repository: they wont be pushed or pulled. Pushing now looks like this:

    $ hg push
    pushing to /home/mg/tmp/repo
    searching for changes
    no changes to push but 2 secret changesets
    

    There is no equivalent mechanism in older versions of Mercurial. There your best bet is to create a local clone for the changesets you don't want to push.

提交回复
热议问题