Merge a pull request
Once you are ready to merge a pull request, and when the reviewers have approved it, click Merge at the top right of the pull request view. You can merge a pull request if you have write (or admin) permission on the project.
Bitbucket Server does not enforce particular review workflows, so anyone with write permission on the repository can merge a pull request, including the person who opened it. This flexibility allows different teams to have different approaches to using Bitbucket Server. If your team requires stricter control, consider using branch permissions to restrict who can merge a pull request to particular users or groups. You might also want to consider using a plugin to enforce a particular workflow, for example to ensure that only approvals from members of your review team allow merging. See Checks for merging pull requests.
In the 'Merge Pull Request' dialog, you can add extra information about the pull request.
The text you add appears between the subject line and the log lines that Bitbucket Server and Git generate.
Delete source branch after merging
Check Delete source branch after merging if you no longer need that branch in the repository. Bitbucket Server checks a few things before allowing the deletion – the branch being merged will not be deleted if:
- The branch is the default repository branch.
- The user does not have permission to delete the branch.
- The branch is subject to an open pull request.
Once accepted, the pull request is marked as merged on the Pull requests tab.
If Bitbucket Server detects a conflict that prevents the merge, notifications are displayed on the Overview and Diff tabs of the pull request. Click More information to see instructions for how to resolve the conflict in your local repository.
Choose a merge strategy
You can choose a merge strategy from the merge dialog of each pull request. Git merge strategies affect the way the Git history appears after a merge has occurred. Repository admins can configure which merge strategies are available and which merge strategy will be the default.
To change the merge strategy when creating a pull request, click the merge strategy in use (next to the Merge button), then select a new one.
To configure merge strategies for a repository:
- In repository settings, select Pull requests.
- In the Merge strategy section, tick the box next to one or more merge strategies to determine which strategies are available to users when merging pull requests.
- Once an option is enabled you can set it as the default merge strategy for that repository by clicking Set as default.