不能樱桃挑(错误) [英] Can't cherry pick (error)
问题描述
-
承诺挑选: https://github.com/CyanogenMod/发生错误:
错误:提交4c98c8df392dfb305d7ffe5deaf9a2bdf7824037是一个合并但不是 - m选项被给出。
致命:樱桃挑选失败
请帮助我,我的回购是基于CM,有一个不同的分支,并为不同的ROM进行了修改。
< blockquote>
-m父母号码
<号码> - 主号码父号码
通常你不能选择合并,因为你不知道合并的哪一边应该被认为是主线。此选项指定主线的父号码(从1开始),并允许樱桃选择重放相对于指定父项的更改。
<请考虑以下提交日志:
B - C
/ \
A - DEFG
现在,如果您告诉git选择G,您会告诉它:执行更改那个承诺G介绍。但这是不明确的 - 关于提交C,G介绍了在D,E和F中所做的更改。关于提交F,它引入了变更B和C.
为了克服这个问题,你需要指定mainline参数,它告诉git C或F是否应该被视为完成比较的主线。
I'm trying to cherry-pick a commit from CyanogenMod Github and having issue, here's more info:
Commit to cherry-pick: https://github.com/CyanogenMod/android_device_lge_bullhead/commit/4c98c8df392dfb305d7ffe5deaf9a2bdf7824037
Error occurring:
error: commit 4c98c8df392dfb305d7ffe5deaf9a2bdf7824037 is a merge but no -m option was given. fatal: cherry-pick failed
Please help me, my repo is based off CM, has a different branch and is modified for a different ROM.
When cherry-picking a merge commit, you need to specify the mainline. The documentation:
-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.
Consider the following commit log:
B - C
/ \
A--D-E-F-G
Now, if you tell git to cherry-pick G, you are telling it: "Take the changes that commit G introduces". But that is ambiguous - in relation to commit C, G introduces changes made in D, E, and F. In relation to commit F, it introduces changes B and C.
To overcome this, you need to specify the mainline argument, which tells git whether C or F should be considered the mainline against which the comparison is done.
这篇关于不能樱桃挑(错误)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!