Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot git merge --abort until git status

Tags:

git

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

like image 889
Sato Avatar asked Jul 03 '18 03:07

Sato


1 Answers

First, we need to run

git status

then

git merge --abort
like image 76
Er Pkumar soni Avatar answered Oct 11 '22 11:10

Er Pkumar soni