Discard a local branch in Mercurial before it is pushed

前端 未结 3 1133
南旧
南旧 2020-12-15 17:43

Many times it happens that I have few commits on my local Hg repository which I don\'t want to push and sometimes I want to remove the local branch altogether. But I cannot

3条回答
  •  [愿得一人]
    2020-12-15 18:34

    If you enable the mq extension (bundled with Mercurial), you can use hg strip. Be careful, though, as this will modify the history of your repository. The safe method is to clone your repository up to the revision preceding the creation of the branch you want to discard, then to pull the remaining changesets that you want to keep.

提交回复
热议问题