Yesterday I cherry-picked two commits into my main branch, one of them caused merge conflicts and I resolved them, committed and pushed them to origin. Today I am attempting to pull from the server when I get the following error:
$ git pull fatal: You have not concluded your cherry-pick (CHERRY_PICK_HEAD exists). Please, commit your changes before you can merge. $
Git status reads:
$ git status # On branch main # Your branch is behind 'origin/main' by 2 commits, and can be fast-forwarded. # $
I have tried the following to no avail:
$ git cherry-pick --continue usage: git cherry-pick [options] <commit-ish> $
Any idea on how I could resolve this? Thanks in advance!
Resolve the conflicts. Resume: Depending on the command that was executed (e.g. rebase, merge, cherry-pick), you will usually need to add the files and call something like rebase --continue or cherry-pick --continue.
Your answer Git cherry-pick is a powerful command that enables arbitrary Git commits to be picked by reference and appended to the current working HEAD. Cherry-picking is the act of picking a commit from a branch and applying it to another.
Cherry-picking works by figuring out the patch—that is, the changes—introduced by a given commit and then applying that patch to the current branch. That might result in conflicts if the commit you decided to cherry-pick builds on changes introduced by an earlier commit you didn't cherry-pick.
Next time try git cherry-pick --abort
, otherwise what you did should more or less work.
Solved with the following: rm .git/CHERRY_PICK_HEAD
I realize this is dangerous as this doesn't guarantee internal consistency within git, but no issues for me so far...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With