git asks for the parent number ( -m ) because your merge has two parents and git don’t know which side of the merge should be considered the main one. Thus, using this parameter, you can specify the parent number (starting from 1) of the main line and cherry selection to reproduce the change relative to the specified parent.
To get to know your parents, try either:
git show
or
git cat-file -p <merge_commit>
or even for better visibility of the GUI, try:
gitk <merge_commit>
As a result, you should get something like:
commit fc70b1e9f940a6b511cbf86fe20293b181fb7821 tree 8d2ed6b21f074725db4f90e6aca1ebda6bc5d050 parent 54d59bedb9228fbbb9d645b977173009647a08a9 = <parent1_commit> parent 80f1016b327cd8482a3855ade89a41ffab64a792 = <parent2_commit>
Then check all your parent data for:
git show <parent1_or_2_commit>
Add --stat to see a list of modified files.
Or use the following command to compare changes (based on the parent described above):
git diff <parent1_or_2_commit>..<commit>
Add --stat to see a list of modified files.
or use combined diff to compare two parents:
git diff --cc <parent1_commit> git diff --cc <parent2_commit>
Then specify the parent number starting with 1 for your cherry pick, e.g.
git cherry-pick -m 1 <merge_commit>
Then run git status to find out what is happening. If you don’t want to commit the changes yet, add the -n option to see what happens. Then when you are not happy, reset to HEAD ( git reset HEAD --hard ). If you run into git conflicts, you may have to manually resolve them or specify a merge strategy ( -X ), see How to resolve merge conflicts in Git?