Remote merge is not happening in Bitbucket Server
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
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
When merging a pull request remotely, the pull request is still open in Bitbucket and no remote merge is shown.
This is how to identify a remotely merged pull request:
- the commit merge message says "<user> remotely merged the pull request from <source branch> to <target branch>
- the status of the pull request is "MERGED"
Cause
Bitbucket will mark a pull request as remotely merged when the source and the target branch contain the same commits. This means that the commits (identified by the hash of the commit) must be present on both branches. If there is at least one difference, Bitbucket will not consider the branch has been remotely merged. Note: the diffs could be the same, what really matters here is the Git history of the two branches.
This usually happens when resolving the conflict via a rebase or a squash commit, in these cases the Git history will be different and the pull request will not be marked as merged.
Resolution
Depending on the goal, the following approaches are possible:
- make sure that the conflicts are resolved in a way that allows the commits to be both on the source and the target branch. This will allow the remote merge to be completed.
- use the required Git workflow by being aware that the remote merge will not complete