"commit your changes before" after a conflict


I tried to do a git cherry-pick , but it failed with a conflict:

$ git cherry-pick master
error: could not apply 456190d... Mejoro el post
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'

I was missing merge ar some previous commits to be able cherry-pick ear that last, and then I did reset to undo the changes and be able to apply the merge :

$ git status --short
DU source/images/uploads/2016/review.png
$ git reset .
$ git status --short
?? source/images/uploads/2016/review.png
$ git clean -fd
Removing source/images/uploads/2016/review.png

But the merge fails:

$ git merge origin/stable 
fatal: You have not concluded your cherry-pick (CHERRY_PICK_HEAD exists).
Please, commit your changes before you merge.

What is the correct way to solve the conflict?

I know I can do rm .git/CHERRY_PICK_HEAD and dodge the problem, but I imagine there will be a more correct way to do it.

asked by mgarciaisaia 19.01.2016 в 00:05

2 answers


The form is

git cherry-pick --abort

this reverts the repository to the previous state.

This option is available since version 1.7.8, mid-2013.

answered by 19.01.2016 / 03:52

After resolving a conflict in the rebase and cherry-pick commands, you have to tell Git that the conflict is resolved. In the case of cherry-pick, the command is as follows:

git cherry-pick --continue

After this, you would not have problems to perform the merge

answered by 19.01.2016 в 17:07