Warning: Multiple merge bases detected. The list of commits displayed might be incomplete

Viewed 44860

In Azure Repos, I have created a PR from branch A to branch B. There aren't any merge conflict displayed. But I end up with the warning message

Warning: Multiple merge bases detected. The list of commits displayed might be incomplete.

Screenshot of error

10 Answers

I got the same message today. I just pulled the latest changes from the destination branch and merged them in the source branch and the issue was resolved.

Just take the latest changes of the destination branch to the source branch and complete the merge. After that this message will not come up on the pull request page.

In my opinion, this is good that Azure DevOps is giving such a warning, so that if you forgot to take the latest from the target branch before finishing your pull request, it may save some time or end moment rush & surprise.

I had this happen to multiple teammates today. It was occurring because they were about to merge a PR into our main branch before merging that main (remote) branch into their (local) branch first. Their local branch was several commits behind.

Once they merged, committed, and pushed, the message disappeared.

If I am correct, this warning is useless, because Azure DevOps also has a feature to detect merge conflicts. And I am getting this warning no matter if there are any conflicts or not:

Enter image description here

If there are merge conflicts detected, then I get this one:

Enter image description here

So I would say the proper way to handle merges is by automatic build pipeline, not a warning that confuses everybody.

I've found I get the message when I pull updates from another branch into the branch I’m trying to merge (update development branch from master and then PR merge back into master, for example).

I've also found this when I’ve forgotten to pull down changes before pushing updates.

This can sometimes happen if your merge is set to "fast-forward" when you have more than one branch implicated, as per the message.

If there are no other conflicts (check Conflicts tab) then you can probably allow the merge to Complete, by selecting (from "..." menu) Restart Merge, then choosing the non fast-forward merge option.

Take this warning seriously. This happens either

  • When your source branch doesn't have the latest destination branch and you have created the pull request.

  • Or you have merged the a branch which is not the origin of your current branch.

    Enter image description here

For the first reason: Take your branch to local, merge the origin of the destination branch to your branch, commit and push. Check the PR now. It must be resolved now. If not, then you must check the second reason.

For the second reason: When you have pushed a branch to your current branch which is not the origin of your current branch.

  • The best solution, if feasible in your case, is to identify the branch which was not the origin of your branch and revert the commit and push it.
  • If not, then create a new branch from the origin of the destination, cherry pick all the commits which are relevant and commit push. Create a new PR from this new branch.

Choose the option based on your feasibility.

This is Azure's way of alerting you to verify and make sure you have not neglected to merge a pull request; it typically occurs when you have an abandoned pull request in the source branch or a previous branch in the tree.

I had to merge latest 'main' in to my 'features/x' branch. The 'features/x' branch was protected, requiring a pull request. The PR had to be completed with fast forward merge. I was trying squash merge, and the 'features/x' branch was not picking up the full commit history. Turns out the directionality of squash merge is something to pay close attention to.

Me and my colleague had the same issue using Azure DevOps. His branch was behind, and all we had to do was:

git pull origin master

from his local branch. This fixed it.

Related