Strange git rebase --continue failure

by jenny on 11 March 2010 - 09:51pm in

$ git pull

CONFLICT (rename/modify): Merge conflict in somefile.txt
Failed to merge in the changes.
Patch failed at 0002 Some commit.

When you have resolved this problem run "git rebase —continue".
If you would prefer to skip this patch, instead run "git rebase —skip".
To restore the original branch and stop rebasing run "git rebase —abort".

…this was an expected conflict, so I resolve it and add the file:

$ git add somefile.txt

Now, to finish up:

$ git rebase —continue
You must edit all merge conflicts and then
mark them as resolved using git add

…wtf? I added that; let’s double-check:

$ git status
# Not currently on any branch.
# Changes to be committed:
#   (use "git reset HEAD <file>…" to unstage)
# modified:   somefile.txt

I tried adding it again for good measure, with the same result. Some googling surfaced this bug; I didn’t bother to read it all the way through, but the punchline is git diff fixes the problem. Weird.

$ git diff

…oh yeah, this reports nothing because I added everything

$ git diff —cached
diff —git a/somefile.txt b/somefile.txt
index 4b011fb..21ccd28 100644
—- a/somefile.txt
+++ b/somefile.txt

$ git rebase —continue
Applying: Some commit.

Wow. First time I’ve run into this… it’s also probably the first time I didn’t run git diff before continuing a rebase…

Thanks :)

Thanks :)

Thanks VERY much!

I had the exact same problem, which your post helped to quickly resolve. Thanks!!


Wow, thanks for posting this! I had the same problem and was getting pretty annoyed about it. It would have been a while before I tried git diff, but likely wouldn't have figured out what made the difference.