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

10

159

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

What does this mean?

Rosanarosane answered 16/9, 2021 at 15:58 Comment(11)
We are seeing this for the first time today as well.Longbow
I can't speak to or for Azure in any way, but multiple merge bases are normal (or normal-ish: they're normal but rare) when looking at branches: they occur as a result of criss-cross merges, for instance.Insufficiency
Can you give more details? Such as what did you do in the branch A?Burglarious
@BowmanZhu-MSFT We started having the same problem yesterday too, even on PR older than 30 days. If I branch master, make some changes and create a PR there is no message. If another PR is merged in the target branch while my PR is not completed the error appears. Never happened before yesterday and happens in every PR from yesterdayBrushoff
We're suddenly getting this too on ADO on long-lived branches where this warning has never been seen before. I've run a few tests and am not seeing anything untoward: Commit history is maintained correctly, changes merged in fine. @BowmanZhu-MSFT this is definitely an issue introduced in ADO in the last 24 hoursKitchen
Some additional info at this Microsoft Developer Community link: vsf-prod.westus.cloudapp.azure.com/content/problem/1530780/…Dominy
@Rosanarosane Could you please add your actual question about this affair? Is your question "why does this happen" or is it "how do I fix it"?Personnel
What is the question?Lists
It seems that as of today 113 people understand the implied question: "Why is this error occurring?"Dominy
115 and possibly counting, the question is very clear for me - "WTF MS is displaying here???", though agree that it is implied which might not be enough for purists ;)Galloping
@Dominy ... while the highest voted answer doesn't care about the reasons. An actual question is helpful.Mauriciomaurie
A
80

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.

Anomaly answered 17/9, 2021 at 9:42 Comment(9)
This way I need to go back every time and see if there are new changes on the destination branch and merge it. There should be a better way though.Balm
Correct, specially when testing things it's worth to pull in the latest changes. I don't agree with you there should be a better way. This just works fine in my opinion.Anomaly
If another PR is merged in destination branch the message reappears and you must pull last changes in every PR waiting. This isn't a feasible approach in my opinion.Brushoff
This worked for me as well.Granese
But that would mean that my master branch got some kind of shadow update which should not be possible due to branch policies in placeDonner
I get the same warning message when creating the PR for destination branch into the source branch. This is happening on our release branches: beta -> master. We only ever merge beta into our master branch, we've never seen this before when merging to master, but now see it in all 3 of our repositories when merging to master.Monegasque
@Anomaly but there’s one problem in this approach. Just imagine your source feature branch is taken out of a branch named as branch1 and you have raised PR to merge from feature branch to a branch named as branch2, in that case you may get changes done by other developers from branch2 to feature branch , and the. If your try to raise PR to merge from feature branch to branch1. You will get unwanted changes. which could not be supposed to go in branch1. So this is just a warning, better way is to resolve the merge conflict in such situations.Regarding
In my case, this didn't help. Merging from destination to source showed me the message "There are no changes to merge between the selected branches.", but still I am getting the warning "Warning: Multiple merge bases detected. The list of commits displayed might be incomplete" So, what can I do in this case?Untwine
So assuming target is 'develop,' locally, you have to git checkout develop, git pull, git checkout original_branch. Then git merge develop. A lot of steps and you have to git status to begin with in case your branch name is long. Can it be made easier? I find tooling in VS2022 at least doesn't make this easy at all.Hesketh
I
23

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 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.

Insolate answered 5/5, 2022 at 7:35 Comment(1)
Upvote. This is the only answer on this page which attempts to answer the question. This is what I came here for.Dalliance
C
21

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.

Chivy answered 20/9, 2021 at 13:24 Comment(6)
Yup - They should have just made it clearer. Literally adding that "Hey, did you forget to sync against latest remote or..?" to the message.Circumvallate
but it has also Merge conflicts message when some merge conflicts are detected. so this warning about multiple bases is useless.Sanderson
That wasn't the solution in my case. See the comment I made to @Anomaly answer.Untwine
The part after "save some time" is incomprehensible. Can you fix it? (But without "Edit:", "Update:", or similar - the answer should appear as if it was written today.)Lists
Except that "sync" is not even a term in git, but a design smell from another VCS which makes people never understand gitScevo
In my case the conflicting commit was made 20 minutes before my PR, so despite my fastidious efforts to merge the latest changes it didn't help. The advice to "complete the merge" is what helped but only after the fact.Suu
L
8

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.

Lavinialavinie answered 22/9, 2021 at 20:9 Comment(0)
S
7

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.

Sanderson answered 24/9, 2021 at 14:39 Comment(5)
The warning is saying that the list of commits may be incomplete, this is not the same as merge conflicts. seeing that warning from the OP does not mean there is a merge conflict, I have got the warning without any conflict. it generally happens with criss-cross merges (e.g. I create a feature branch against latest version, then I do a hotfix against old version and merge the fix into my release branch for latest version). in these complex cases then Azure DevOps can't guarantee its list of commits being merged is correctFaucet
So I guess the warning should be visible only on the Commits tab? and there is something wrong with coloring of that warning. Also, we are working only on develop, with multiple feature branches being completed in various order, and still seeing this warning all the time actually.Sanderson
In our small project team consisting of 5 developers with multiple PRs at the same time I basically get this warning on every PR. Have been seeing that for a month already and I want to confirm that this warning is useless to me.Sanderson
Please review Why not upload images of code/errors when asking a question? (e.g., "Images should only be used to illustrate problems that can't be made clear in any other way, such as to provide screenshots of a user interface.") and do the right thing (it covers answers as well). Thanks in advance.Lists
The message can be ignored in some cases, but it is also possible to be a problem. In some cases, as it has been outlined by other answers, a merge can produce an unwanted result and this message by the OP warns the user about it.Kipkipling
A
1

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.

Align answered 17/9, 2021 at 8:3 Comment(0)
B
1

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.

Birthday answered 4/10, 2021 at 16:11 Comment(2)
I think this is my problem. I did a PR from dev-branch to qa-branch and got this message. I was able to abandon and do master to qa-branch without any issues (which reminded me from where the qa-branch was created from). So, to ensure that I can do dev-branch to qa-branch and not get the error, I should simply change the merge option next time? I really need this to go from dev-branch to qa-branch and not master.Hue
From what you say, that should work.Birthday
M
1

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.

Matthew answered 16/2, 2022 at 12:20 Comment(0)
M
1

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.

Murdock answered 23/6, 2022 at 20:36 Comment(1)
So if a PR was abandoned resulting in "multiple merge bases...", what is the repair action?Spoken
S
1

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.

Spoken answered 13/9, 2022 at 23:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.