How can I back out a merge in Mercurial and later remerge with that branch?

前端 未结 6 799
误落风尘
误落风尘 2021-01-30 10:33

I have two branches, default and branch1. By mistake one person in our team merged branch1 with default. The content in branch1 is not yet ready to merge with default (it contai

6条回答
  •  既然无缘
    2021-01-30 11:01

    We did an experiment with 'hg backout', backing out the merge (not sure this is the right way to do it). Then the changes from branch1 gets deleted on default, which is fine - but we can not remerge with branch1.

    I use backout for merge cancel. You can not remerge, but you able to "backout backout merge", i.e. when you want remerge, you make 'hg backout' on "Backed out merge changeset ..." commit and then merge branch again.

    Example:

      7     M       remerge
      6   /   \
      5   *   |     hg backout 3 (backout backout)
      4   |   *     fix error 
      3   *   |     hg backout 2
      2   M   |     fail merge
        /     \
      1 *     *
        |     |
    

提交回复
热议问题