菜鸟笔记
提升您的技术认知

git revert merge会出现的问题-ag真人游戏

比如当我们git revert的时候,

git revert 

git会抱怨:

is a merge but no -m option was given

这是因为你revert的那个commit是一个merge commit,它有两个parent, git不知道base是选哪个parent,就没法diff,所以就抱怨了,所以你要显示告诉git用哪一个parent。

git revert sidsad8 -m 1

这样就选parent 1,那么parent 1又是哪一个呢?

一般来说,如果你在master上mergezhc_branch,那么parent 1就是master,parent 2就是zhc_branch.

often this will be parent number one, for example if you were on master and did git merge unwanted and then decided to revert the merge of unwanted. the first parent would be your pre-merge master branch and the second parent would be the tip of unwanted.

网站地图