Github: Changes ignored after revert (git cherrypick, git rebase)

后端 未结 2 1593
你的背包
你的背包 2021-01-13 22:28

Lets say I have two branches A and B

(A)--------(A+B)--------------(A+B+R)
 \\        / merge   \\ revert  /
  \\      /                    


        
2条回答
  •  情话喂你
    2021-01-13 23:05

    You need to revert the revert, i.e. revert the commit that your previous revert created.

    The reason for this is that a merge really does 2 things: it changes the file contents to reflect the merge, and also creates a commit with 2 parents to tell git what was merged. When you revert, it undoes the first thing, but not the second. So when you try to re-do the merge, git has no idea that you reverted the previous merge, so it ignores everything before then.

提交回复
热议问题