Cannot git merge --abort until git status
Cannot git merge --abort until git status
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 --abort
git status
git merge --abort
$ 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
1 Answer
1
Is anything I'm doing wrong?
No: the git merge --abort should have worked, without having to run git status first. Report a bug for whichever Git version you are using. Edit: 1.8.3.1 is positively ancient. You should upgrade if possible.
git merge --abort
git status
@jthill: he hadn't named his Git version when I posted that. :-)
– torek
Jul 3 at 5:37
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
1.8.3.1 is half a decade old...
– jthill
Jul 3 at 5:35