I had a master
with a few commits, I moved back to the first commit, created a branch from there and used cherry-pick
to apply one of the commits from the master
branch. But due to some conflicts I got a message like:
Automatic cherry-pick failed. After resolving the conflicts,
mark the corrected paths with 'git add <paths>' or 'git rm <paths>'
and commit the result with:
git commit -c some_hash_id
The problem is, resolving the conflicts took me a while and in the meantime I closed the terminal with the message and now I don't know what commit hash I should use when committing the resolved files. How do I find it out?
If I didn't provide enough details, please ask for them in the comments.
Edit:
$ git status
# On branch upgrade
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: file1.php
# new file: file2.php
#
# Unmerged paths:
# (use "git reset HEAD <file>..." to unstage)
# (use "git add/rm <file>..." as appropriate to mark resolution)
#
# both modified: file3.php
# both modified: file4.php
# both modified: file5.php
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# [long list of files...]
file3.php
, file4.php
and file5.php
are the ones I had to resolve conflicts in.
$ git cherry-pick --continue
error: unknown option `continue'
usage: git cherry-pick [options] <commit-ish>
-n, --no-commit don't automatically commit
-e, --edit edit the commit message
-x append commit name when cherry-picking
-r no-op (backward compatibility)
-s, --signoff add Signed-off-by:
-m, --mainline <n> parent number
--rerere-autoupdate update the index with reused conflict resolution if possible
--ff allow fast-forward
$ git cherry-pick --abort
error: unknown option `abort'
usage: git cherry-pick [options] <commit-ish>
-n, --no-commit don't automatically commit
-e, --edit edit the commit message
-x append commit name when cherry-picking
-r no-op (backward compatibility)
-s, --signoff add Signed-off-by:
-m, --mainline <n> parent number
--rerere-autoupdate update the index with reused conflict resolution if possible
--ff allow fast-forward
But the docs say:
--continue
Continue the operation in progress using the information in .git/sequencer. Can be used to continue after resolving conflicts in a failed cherry-pick or revert.
And I don't have such file (I checked) so maybe I can't use these commands now.
I'm using git version 1.7.1.