当我做git cherry-pick时,出现此错误,我该如何解决?
$ git cherry-pick XXXXXXXXXXXXX
error: commit XXXXXXXXXXXXX is a merge but no -m option was given.
fatal: cherry-pick failed
$ git cherry-pick
-m, --mainline <n> parent number
$ git cherry-pick -m 1234 XXXXXXXXXXXXX
$ error: commit XXXXXXXXXXXXX does not have parent 1234
fatal: cherry-pick failed
最佳答案
我认为帮助/手册页非常清楚地说明了为什么需要-m参数,并且错误消息清楚地说明了您需要它:
-m parent-number, --mainline parent-number Usually you cannot cherry-pick a merge because you do not know which side of the merge should be considered the mainline. This option specifies the parent number (starting from 1) of the mainline and allows cherry-pick to replay the change relative to the specified parent.
关于git - 错误: commit is a merge but no -m option was given,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41842149/