Rebase and merge is blocked incorrectly? #27521
Replies: 6 comments 3 replies
-
We just observed the same symptom, too. I verified that the merge conflict is only observed by GitHub; it's not reproducible on development laptops using git command-line. Both merging master into the PR branch, and merging the PR branch into master, works cleanly without conflict when using git command-line. The git command line version I'm using is I tried the following workaround, and it seemed to work. First, rebase master and then squash the PR branch (so that the PR branch is only one commit on top of the latest master), then force push. If this doesn't resolve the GitHub false merge conflict, try create another branch with the same content (commit), and push that new branch and open a new PR. I see that the false merge conflict on GitHub goes away with this new PR. |
Beta Was this translation helpful? Give feedback.
-
I am also affected |
Beta Was this translation helpful? Give feedback.
-
I'm encountering a similar issue. Everything functions correctly in my local environment, but the problem only arises when using the GitHub UI. |
Beta Was this translation helpful? Give feedback.
-
I ran into the issue too |
Beta Was this translation helpful? Give feedback.
-
Getting this too. I.e. on the command line I get a warning like this.
Maybe GitHub's rebase functionality interprets those warnings as errors? |
Beta Was this translation helpful? Give feedback.
-
My team is still running into this issue sporadically when opening a PR that merges staging into main. We select "rebase and merge" when merging these PRs. Sometimes new PRs open without issue but sometimes we get the error that the branch can't be automatically merged because of conflicts. We weren't able to open a PR merging staging into main today because the button was greyed out. When we created a duplicate branch staging2 we were able to open a PR but it had conflicts. Locally the rebase succeeds without any conflicts but did have some skipped commits as @KalleRaiskila-synthara described above. We were not able to merge this PR with the rebase and merge strategy because Github said said the PR could not be rebased safely. The issue doesn't arise every time we have skipped commits but I think has only happened when we have skipped commits. Our workaround has been to reset main to match staging (and force push to main 😢) so the commit shas are the same. That solves the problem for at least one deploy but we somehow end up in this state again. I've used the rebase and merge strategy for releasing to main in the past without any issues. Not sure what's different here, but the fact that it works locally and not on Github makes me think something has changed. |
Beta Was this translation helpful? Give feedback.
-
Hello,
My team is relatively new to GitHub and we have been experiencing an intermittent issue.
Our repository requires linear history and we only allow the rebase and merge option for pull requests. It is a large repository and sometimes PRs are merged every 5-10 minutes or so throughout the day. Usually the rebase and merge process works as expected. Occasionally, however, the rebase and merge button is blocked/greyed out and GitHub has a message saying "This branch cannot be rebased due to conflicts."
When this happens, there are no real conflicts and a local, manual rebase from main will always complete without incident. Usually there is no crossover whatsoever amongst the files involved.
After performing a manual rebase locally, and then force-pushing to the PR, we sometimes have the message clear but sometimes not. It seems to us, anecdotally, that any other PR merging to main between when we rebase and when we view the PR will trigger the blocking message "This branch cannot be rebased due to conflicts." For some reason, the ability to automatically rebase and merge just never functions at all with certain pull requests.
We cannot figure out why, in most cases, GitHub is able to automatically rebase and merge even when there are later commits to main, but on some specific PRs we simply cannot get this to work and have to manually rebase, push, and then quickly click rebase and merge before the main branch is touched again.
Does anyone have any thoughts on this?
Thanks,
Brett
Beta Was this translation helpful? Give feedback.
All reactions