Delete all local changesets and revert to tree

后端 未结 7 811
小蘑菇
小蘑菇 2021-01-29 20:25

I\'m using Mercurial and I\'ve got into a terrible mess locally, with three heads. I can\'t push, and I just want to delete all my local changes and commits and start again with

7条回答
  •  情书的邮戳
    2021-01-29 21:00

    If you are using TortoiseHg, one simple way to get out of a (small) mess is to first update to the latest revision, then select your changesets and initiate "merge with local". When the merge dialogue appears, simply click the little '+' icon to reveal some extra options, one of which is "discard changesets from merge target (other) revision". Doing this will mean your changesets will still be in the repo and get pushed, but will have no effect, because they will be discarded in the merge. If you have a lot of changesets spanning many heads, you might not want to pollute the repo this way, but it's a simple fix and worth considering if the changesets you are discarding contain data that you may later want to reference.

提交回复
热议问题