How do you fix a failed rebase with git?
I received a pull request on github for some relevatively minor changes to a single file, so I accepted and then in my local branch, fetched the changes and performed a rebase.
However, for some reason, git found conflicts, even though I had not modified the file since the contributor's modification. I used EGit to resolve the conflicts, which were trivially, but now I'm stuck. EGit lists my project as in "rebase interactive" mode and it's still showing the file as conflicting. If I try to do a "Rebase->Continue Rebase" I receive the error "Repository contains unmerged paths". How do I resolve this?
The way to mark files as resolved (in both EGit and command line Git) is to add them to the index:
Open the context menu of the file > Team > Add to Index
After that, continuing the rebase should be possible.
After Git starts the rebase operation you need to:
Hopefully the merge succeeds at this point!
For the case where Git thought there were conflicts but there weren't really any, in step (2) when you drag the files to Staged Changes they will disappear. In step (3) you will need to select Rebase > Skip.
Good luck.
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