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!
Another option: with Git 2.23 (Q3 2019), a
git cherry-pick --continue
will actually work!When one step in multi step cherry-pick or revert is reset or committed, the command line prompt script failed to notice the current status, which has been improved.
See commit e981bf7 (01 Jul 2019) by Phillip Wood (
phillipwood
).(Merged by Junio C Hamano --
gitster
-- in commit 8a4acc5, 19 Jul 2019)Since my previous answer from 2014, the proper command nowadays (2018) is
git cherry-pick --quit
.And before Git 2.19 (Q3 2018), "
git cherry-pick --quit
" failed to removeCHERRY_PICK_HEAD
even though we won't be in a cherry-pick session after it returns, which has been corrected.See commit 3e7dd99 (16 Aug 2018) by Nguyễn Thái Ngọc Duy (
pclouds
).(Merged by Junio C Hamano --
gitster
-- in commit 39e415c, 20 Aug 2018)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...Next time try
git cherry-pick --abort
, otherwise what you did should more or less work.If the
git cherry-pick --continue
doesn't work, that means git is too old: that option was introduced for git 1.7.8 (Dec. 2011) in commit 5a5d80fThese days (2014), that would be the command to use when you see "
You have not concluded your cherry-pick
".