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

GitAzureAzure DevopsAzure Repos

Git Problem Overview


In Azure Repos, I have created a PR from branch A to branch B. There are no 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

Git Solutions


Solution 1 - Git

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.

Solution 2 - Git

Just take the latest changes of destination branch to 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 and it may save some time or end moment rush & surprise.

Solution 3 - Git

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.

Solution 4 - Git

If I am correct, this warning is useless, because DevOps has also 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.

Solution 5 - Git

I've found i get the message when i pull updates from another branch into the branch i'm trying to merge(Update dev 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.

Solution 6 - Git

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.

Solution 7 - Git

Take this warning seriously. This happens either

  • When your source branch don't have the latest of 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 reason first: Take your branch to local, merge the origin of 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 reason second: When you have pushed a branch to your current branch which is not the origin of your current branch.

  • Best solution, if feasible in your case, 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 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.

Solution 8 - Git

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

git pull origin master

from his local branch, this fixed it

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJananiView Question on Stackoverflow
Solution 1 - GitJorn.BeyersView Answer on Stackoverflow
Solution 2 - GitJARVISView Answer on Stackoverflow
Solution 3 - GitT HView Answer on Stackoverflow
Solution 4 - GitJuriView Answer on Stackoverflow
Solution 5 - Gitnewky2kView Answer on Stackoverflow
Solution 6 - GitMikeWView Answer on Stackoverflow
Solution 7 - GitKushalSethView Answer on Stackoverflow
Solution 8 - GitDrFaradayView Answer on Stackoverflow