Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot merge pull request if any changes have been made on the target branch

Jon Kruger May 17, 2018

We are unable to merge any pull requests if any changes have been made to the target branch.  Here's a basic example that happens every day:

  • Two branches are created off of the same commit in the master branch
  • Work is done in each branch, and then a pull request is submitted for each one.  The work was done in different areas so there will be no merge conflicts when they are merged in.
  • First pull request is merged - merges successfully
  • Second pull request is merged - You get an error message that says "New changes were pushed to master in POOL/demo while the merge was being performed.  Please retry the merge."

We are unable to merge pull requests if ANY changes were made to the target branch after the pull request was created.  I would expect it to deny the merge if there were actual merge conflicts, but it happens every time whether there are merge conflicts or not.

We are on Bitbucket Server 5.9.

2 answers

1 accepted

2 votes
Answer accepted
Andrei Khudavets
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 17, 2018

Hi Jon,

What happens when you re-try your merge attempt after some time?

There is a known Bitbucket Server issue. When the target branch is updated, Bitbucket starts background re-scoping to update all pull requests opened against this branch. While re-scoping is running, other pull request will fail to merge. 

Here is the issue I am referring to: https://jira.atlassian.com/browse/BSERV-9709

Jon Kruger May 18, 2018

I just tried again today and it still doesn't merge.  Is it possible the background re-scoping is failing on our server?  How do we troubleshoot that?

Andrei Khudavets
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 20, 2018

If the problem persists, then something is wrong with the server. I recommend to raise a support request. They will be able to analyse your log files and solve the problem.

0 votes
deanlot
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 12, 2020

I know this is an old thread, but we experience this often. As this is still indexed on google, I though this might be useful for others.

 

I found that pushing directly to your target branch resolves this issue. You would need to adjust your settings in the repo to allow direct pushes if you have prevented this.

Eg.

PR from feature/abc -> develop

clicking merge on BB server UI fails with above error.

on local env:

  • git checkout develop
  • git pull origin feature/abc
  • git push

After this, bitbucket will automatically mark the original PR as merged, and you should be able to merge any other PR's now without issue.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events