This branch cannot be rebased due to conflicts

This is the first time that I had to resolve a conflict in a PR. When I first tried to merge the PR, Github gave me the option to edit the conflict, which I chose to do. I thought that I made the edits correctly and went to close the PR. But I must have done something wrong. Now I have the message “This branch cannot be rebased due to conflicts” (see screen shot). But now I don’t see an option to edit the conflict. Is there a way to get back into the Github editor to edit the conflict? Also, can you tell from the screen shot, what I did wrong?

2 Likes

Hm I don’t think you did anything wrong. 

I tried to reproduce this and I encountered the same message, so I think this is expected behaviour.

You couldn’t go back to the resolve conflict editor using the web UI because you had already resolved the conflict.

This Stackoverflow article explains why there are merge conflicts caused by rebase but not other methods, I guess this is also why we couldn’t do it via the GitHub web UI:

https://stackoverflow.com/questions/38391714/git-why-does-rebase-result-in-conflicts-while-merge-does-not

You should have been able to “create a merge commit” or “squash and merge”, but for “Rebase and merge”, it could only be done via command line:

https://help.github.com/articles/about-pull-request-merges/#rebase-and-merge-your-pull-request-commits

I hope this helps!

3 Likes

Excited to learn more about here!

1 Like

We are having the same issue. This is annoying because the conflict only happens if you use the --no-ff option when doing a git merge, but when doing the rebase, according to the documentation, is actually does a fast-forward, thus our PR should be valid, without problems.

It seems we are blocked due to unfortunate UX. I even tried to do the rebase and merge from the github CLI, but the same error show up “Pull request … has conflicts and isn’t mergeable”.

We are likely able to work around this, but it is a bit unfortunate that our CI/CD system has to be re-engineered because of a UX issue.