Pull Request Won't Merge Changes to Master Branch
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Problem
If you create a branch off of master, make some commits and then create a pull request from the new branch back to master, initially in pull request creation page, you can see the diff and it is correct. Once the pull request is made you cannot see the diff.

Once you merge the pull request, no merge commit is actually made. Furthermore, the master branch does not update with the new commits even though the pull request is marked as merged. No errors will occur in the logs.
Cause
A setting in the .gitconfig
file on the Bitbucket Server instance :
1
2
3
4
[branch]
autosetupmerge = always
[branch "master"]
mergeoptions = --no-commit --no-ff
This option stops the merge on master.
This configuration is typically set to prevent people from committing and pushing directly to the master.
Resolution
You can remove this configuration from the ~/.gitconfig
file in your home folder. This is where all --global
settings are saved.
Was this helpful?