Bitbucket merge checks: which one stops the merge
Merge checks are the conditions a branch sets before its pull requests merge: enough approvals, passing builds, no open tasks. Whether an unmet check only warns or actually stops the merge depends on where the repository lives: in Bitbucket Cloud it stops the merge only with Premium and one more setting, in Bitbucket Data Center an enabled check vetoes the merge. When a pull request will not merge, the first question is which check is unmet, and the answer is often a detail of how that check counts.
Bitbucket Cloud
From Atlassian's page Suggest or require checks before a merge:
- The checks: Minimum number of approvals; Minimum number of approvals from default reviewers; No changes are requested; No unresolved pull request tasks; Minimum number of successful builds for the last commit with no failed builds and no in progress builds; Maximum number of commits behind destination branch.
- Warn or block: without Premium, Bitbucket warns about unresolved merge checks and the pull request can still be merged. To stop the merge, the workspace needs Premium and the branch the setting Prevent a merge with unresolved merge checks. Even then the checks guard merges made in Bitbucket only: a merge pushed from a clone straight to the branch marks the pull request as merged without them, so limit who can write to the branch too (a pull request that merged by itself).
- Where: the repository's Settings → Branch restrictions (under Workflow); merge checks are part of a branch restriction for the target branch. A project's branch restrictions and a repository's don't override each other: Bitbucket applies the stricter one, so a repository can't turn off a check its project sets. Put the loosest checks at project level and add the stricter ones per repository (Cannot override project level merge check at repository level).
- Approvals: the author may approve their own pull request, but that approval does not count toward the minimum. With Premium, Reset approvals when the source branch is modified removes all approvals after a push, and Keep approvals if there is no change to the diff in the pull request keeps them when the diff stays the same. In the API they are the branch restriction kinds
reset_pullrequest_approvals_on_changeandsmart_reset_pullrequest_approvals, so a script can set them on many repositories withPOST /2.0/repositories/{workspace}/{repository}/branch-restrictionsand an API token with admin:repository:bitbucket (the knowledge base's example).
Bitbucket Data Center
From Atlassian's page Checks for merging pull requests (Data Center 10.5):
- The built-in checks: All reviewers approve; Minimum approvals; Minimum successful builds; No 'changes requested' status; No incomplete tasks. Besides these, Code Insights checks (a report, its result, annotations of a severity) and Required builds (named builds on protected branches).
- Where: for all of a project's repositories, Project settings → Merge checks (a project admin can stop repositories from changing them); for one repository, Repository settings → Merge checks; Code Insights and Required builds have their own settings pages.
- Blocking: an enabled check vetoes the merge. The REST API answers
GET …/pull-requests/{id}/merge("Test if pull request can be merged") withconflicted, anoutcomeand a list ofvetoes, each with asummaryMessageand adetailedMessage: the checks' own words for what is missing.
From Data Center to Cloud: the matching restrictions
Branch restrictions do not come along when a repository moves from Bitbucket Data Center to Cloud: set them again on the web page or through the API. Atlassian's knowledge base pairs them up (Merge checks comparison between Bitbucket server vs Bitbucket cloud):
| Data Center | Bitbucket Cloud |
|---|---|
no-deletes | Allow deleting this branch, left off |
pull-request-only | Merge access via pull requests: everyone with access, or only specific people or groups |
requiredApproversMergeHook | Minimum number of approvals |
incomplete-tasks-merge-check | No unresolved pull request tasks; to block the merge, Prevent a merge with unresolved merge checks (Premium) |
read-only | Write access given to no one |
requiredBuildsMergeCheck | Minimum number of successful builds for the last commit with no failed builds and no in progress builds |
force-push-hook | Allow rewriting branch history, left off |
all-approvers-merge-check | None. BCLOUD-14510 asks for it (Gathering Interest on November 10, 2026). Instead, make the people who must approve default reviewers and use Minimum number of approvals from default reviewers |
needs-work-merge-check | No changes are requested |
What to look at
- Approvals: count the approvals of reviewers other than the author. In Bitbucket Cloud with Premium and approvals reset on push, a push after the approvals has removed them.
- Builds: in Bitbucket Cloud the check looks at every build status on the last commit of the source branch, and one failed status fails it, even if a later run of the same build passed. Atlassian's article Merge check fails when commit build statuses are created via Bitbucket Cloud API says to give the runs the same
key, so the newest status replaces the older one. - Tasks and requested changes: an open task, or a reviewer's "changes requested", keeps the check unmet until it is resolved or withdrawn.
- Commits behind: merge the target branch into the source branch, or rebase, and push. Sync now on the pull request does the same if you may write to the branch ("Unable to sync branch").
- Conflicts are not a merge check but stop the merge as well: resolve them in a clone of the repository (merge or rebase locally) and push (resolving merge conflicts).
Merge checks in IntelliJ IDEA
Pull Request Inbox for Bitbucket, a plugin by Lesstep for JetBrains IDEs 2024.1 or later, lists the pull requests that wait for your review in an IDE tool window, from Bitbucket Cloud and, in beta, from Bitbucket Data Center 8.9 or later. Next to each pull request it shows the merge checks in words: "1 of 2 approvals", successful builds, open tasks, commits behind the target branch, custom checks by name, conflicts, and which of them block the merge; from Data Center, the vetoes in the server's own words. The review inbox, diffs, discussions and merge checks are free; approving, commenting and merging are Pro (US$1.50 a month, with a 30-day trial).
Get it on JetBrains Marketplace
Bitbucket and Atlassian are trademarks of Atlassian; IntelliJ IDEA is a trademark of JetBrains s.r.o. This page is not affiliated with or endorsed by Atlassian or JetBrains.
More: Bitbucket Cloud branch restrictions · The merge commit's author is the pull request's author · a pull request merged by itself · no Merge button, or a greyed-out one · pull request builds and Required builds · pull request tasks and default tasks · resolving comments · Request changes and Needs work · Bitbucket auto-merge · Bitbucket merge strategies · modify a pull request based on out-of-date information (Data Center) · pre-receive hook declined · Bitbucket merge queues · Bitbucket pull request plugins for IntelliJ IDEA, compared · 日本語