fiqri@fiqri-X441UA:~/android_kernel_xiaomi_vince-4.9$ git cherry-pick 89a3491a2092de1d672644b273fcdfea46604319
error: commit 89a3491a2092de1d672644b273fcdfea46604319 is a merge but no -m option was given.
fatal: cherry-pick failed
Asked
Active
Viewed 67 times
-6

phd
- 82,685
- 13
- 120
- 165

Fiqri Ardyansyah
- 1
- 1
-
3"but no -m option was given" - Perhaps add the -m option! – Ed Heal Aug 09 '19 at 11:31
-
https://stackoverflow.com/questions/12626754/git-cherry-pick-syntax-and-merge-branches – phd Aug 09 '19 at 11:41
-
https://stackoverflow.com/search?q=%5Bgit-cherry-pick%5D+error%3A+commit+is+a+merge+but+no+%22-m%22+option+was+given – phd Aug 09 '19 at 11:41
1 Answers
0
From https://git-scm.com/docs/git-cherry-pick
-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.
I guess you are trying to give a merge commit to cherry-pick. You need to specify the parent-number
in such cases.

Community
- 1
- 1

Rishikesh Raje
- 8,556
- 2
- 16
- 31
-
A little more backgroind on the answer. When you ask to cherry-pick a merge-commit, you have to tell git from which parent you want to consider the changes to be cherry-picked. Think about it. On a normal cherry-pick git only has one parent for the revision cherry-picked so figuring out the changes that were done on the revision cherry-picked is simple... but if you have more than one parent (on the revision being cherry-picked), from the point of view of each of those parents, the changes performed on the merge revision are different... so you specify _from which_ parent to do the analysis. – eftshift0 Aug 09 '19 at 15:49