Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Conclude a Git Cherry-Pick?

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!

like image 625
Stunner Avatar asked Sep 13 '12 00:09

Stunner


People also ask

How do you resolve conflict in cherry pick?

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.

What is in git cherry pick?

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.

How does cherry pick work?

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.


2 Answers

Next time try git cherry-pick --abort, otherwise what you did should more or less work.

like image 52
Christopher Avatar answered Sep 23 '22 01:09

Christopher


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...

like image 20
Stunner Avatar answered Sep 21 '22 01:09

Stunner