First I merge sth, then conflicts occurs, so I git merge --abort
, but failed, I have to do git status
first, then git merge --abort
succeeded.
$ git merge features/test
Auto-merging src/cmd.c
CONFLICT (content): Merge conflict in src/main.c
Auto-merging src/client.c
Automatic merge failed; fix conflicts and then commit the result.
$ git merge --abort
error: Entry 'src/option.h' not uptodate. Cannot merge.
fatal: Could not reset index file to revision 'HEAD'.
$ git merge --abort
error: Entry 'src/option.h' not uptodate. Cannot merge.
fatal: Could not reset index file to revision 'HEAD'.
$ git status
# On branch te
# You have unmerged paths.
# (fix conflicts and run "git commit")
#
# Changes to be committed:
#
**********
#
# Unmerged paths:
# (use "git add <file>..." to mark resolution)
#
**********
#
$ git merge --abort
$ git status
# On branch te
nothing to commit, working directory clean
Is anything I'm doing wrong?
git version 1.8.3.1
First, we need to run
git status
then
git merge --abort
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