Steven Surowiec
Steven Surowiec

Reputation: 10220

git rebase not continuing after fixing conflicts

I ran a git rebase origin/[branch] on a branch that is the result of merging multiple local branches together during development. As expected I ran into some conflicts and began fixing them. The first several were fine. Git listed the files, I cleaned them up, did the appropriate git add [file] for each one and then did a git rebase --continue and on it went.

But now I've hit a patch that conflicted and is cleaned up but I can't continue for some reason. I've cleaned up the files and all of them are staged but when I git rebase --continue I get:

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

I know for a fact this commit in question removes a file that was later re-added and modified. But when I git status all I see is:

$ git status
# Not currently on any branch.
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
# modified: [file 1]
# modified: [file 2]
# modified: [file 3]
#

The file that was deleted is not shown.

So there's no files left to modify but git insists I still have to do something else before I can continue on my way.

Upvotes: 4

Views: 3445

Answers (2)

Dmitry Oksenchuk
Dmitry Oksenchuk

Reputation: 121

You can try git ls-files -u to get the list of files git considers to be not merged.

Upvotes: 0

Steven Surowiec
Steven Surowiec

Reputation: 10220

Figured this problem out and putting this here in case anyone else encounters it:

I noticed the file that I thought was removed in this commit was still on the file system, and was being tracked by git still. So I did a git rm [file] on it and got the following message:

$ git rm [file one]
[file two]: needs merge
rm '[file one]'

When I checked [file two] sure enough it was still in a conflicted state and needed to be fixed. Upon fixing it up and staging I was able to git rebase --continue. I'm still not sure why the deleted file was not showing as deleted or why this file wasn't being shown as needing to be fixed when doing git status though.

Upvotes: 4

Related Questions