skip to content

Repositories and Pull Requests

Bitbucket organizes repos under workspaces and projects, and gates merges with branch permissions and merge checks rather than GitHub-style rulesets. Its selling point in interviews is usually the Jira link: smart commits move issues without opening a browser.

on this pageshow

explore

questions

6

In Bitbucket Cloud, why can a developer merge a pull request with one approval when main's merge check requires two?

level: middleimportance: must knowfreq 34%

answer

  1. warning versus block
  2. which plan enforces
  3. one setting flips it
  4. whose approval does not count
  5. checks attach to a branch

basics

~20 s

Bitbucket Cloud merge checks only warn unless the workspace is on Premium and the restriction selects Prevent a merge with unresolved merge checks. Without that, the merge checklist shows the missing approval but anyone with merge access can still merge.

solid answer

~40 s

Merge checks live in the branch restriction for a branch or pattern: minimum approvals, minimum approvals from default reviewers, no changes requested, no unresolved pull request tasks, a minimum number of successful builds on the last commit with none failed or in progress, and a maximum number of commits behind the destination. On any plan they produce a **merge checklist** that warns. Only on **Premium** can an admin select **Prevent a merge with unresolved merge checks**, which blocks merging until the list is clear. Two more traps: the author's own approval never counts toward the minimum, and a check on `main` says nothing about a pull request into `develop`. Premium also offers **Reset approvals when the source branch is modified**, so an approval given before a late push stops counting.

go deeper

for a junior

Recall that merge checks list conditions such as approvals, builds and tasks, and that a checklist with warnings does not always stop a merge.

for a middle

Explain warn versus enforce: which plan and which setting turn checks into a block, and why the author's approval does not count.

for a senior

Walk through diagnosing a merge that slipped through: plan, enforcement setting, which restriction matched the target branch, and stale approvals.

for a principal

Decide which checks justify blocking and which should stay advisory, weighing review fatigue from approval resets against the risk of stale approvals.

## What a merge check is In Bitbucket Cloud a **merge check** is a condition attached to a branch restriction — a branch name, a pattern or a branch type — that a pull request into that branch is expected to meet before it is merged. Branch permissions decide *who* may merge; merge checks decide *when*. When a pull request is about to be merged, the unmet checks appear as a **merge checklist**, each unresolved item with a warning label. The checklist is what a developer sees. Whether it actually stops them is a separate question, and that is where most "why did this merge?" incidents come from. ## The checks you can select | Setting | What it checks or does | Plan | |---|---|---| | **Minimum number of approvals** | Fewer approvals than the number set; the author's own approval does not count | Any | | **Minimum number of approvals from default reviewers** | Too few approvals from the default reviewers | Any | | **No changes are requested** | Any reviewer has marked *Changes requested* | Any | | **No unresolved pull request tasks** | The pull request has open tasks | Any | | **Minimum number of successful builds for the last commit with no failed builds and no in progress builds** | The latest commit lacks enough green builds, or has a failed or running one | Any | | **Maximum number of commits behind destination branch** | The source branch has fallen too far behind | Any | | **Prevent a merge with unresolved merge checks** | Turns every check above into a block | Premium | Builds come from whatever reports commit status to Bitbucket: its own Pipelines, a build tool integration, or the commit status REST API. ## Warn versus enforce This is the heart of the question: - **Without Premium**, every check above is advisory. Bitbucket warns users with unresolved checks, but they can still merge. - **With Premium**, an admin can select **Prevent a merge with unresolved merge checks** on the restriction. Then the merge cannot be executed until the checklist is clear. So a team that set "minimum 2 approvals" on a Standard workspace has written down a policy, not enforced one. The fix is the plan plus the setting, not another check. ## Approvals that go stale An approval is given against a version of the pull request. If the author pushes more commits afterwards, the approval may describe code that has since changed. The settings that handle this: - **Reset requested changes when the source branch is modified** (any plan): clears *Changes requested* statuses on a new push. - **Reset approvals when the source branch is modified** (Premium): the pull request drops back to zero approvals after any change to the source branch. - **Keep approvals if there is no change to the diff in the pull request** (Premium): keeps approvals when a push does not change the diff — an empty commit, or a rebase that introduces nothing new. Pairing the last two is the usual choice: approvals reset on real changes, but not on a no-op rebase. ## Diagnosing a merge that slipped through 1. **Check the plan.** If the workspace is not on Premium, the check could only warn. 2. **Check the setting.** On Premium, confirm *Prevent a merge with unresolved merge checks* is selected on the restriction that matches the target branch. 3. **Check the target.** A check on `main` does not apply to a pull request into `develop` or `release/2.4`; find which restriction, name, pattern or type actually matched. 4. **Check who approved.** The author's own approval is not counted, so "two approvals" with the author's among them is still one. 5. **Check timing.** Without approval reset, an approval from before a late push still counts. ## Beyond the built-in checks - **Allow automatic merge when builds pass** lets a user select Merge while the build is still running once every other check is met; the merge happens when the build succeeds and is blocked if it fails. - **Custom merge checks** are apps a workspace admin installs and enables; on Premium they can be marked `required` at workspace, project or repository level, and a check required higher up cannot be switched off lower down. Builds that feed these checks are configured elsewhere; for the merge check, all that matters is the status reported on the last commit.

  • In Bitbucket Cloud, a reviewer approves and then the author pushes a risky commit. How do you stop the old approval counting?
    On Premium, select Reset approvals when the source branch is modified, so any push drops the pull request back to zero approvals. Pair it with Keep approvals if there is no change to the diff, so a rebase or empty commit that changes nothing does not force a fresh review.
  • What does Allow automatic merge when builds pass change in Bitbucket Cloud?
    Once every merge check except successful builds is met, a user can select Merge while the build is still running. The merge then completes as soon as the build succeeds, and is blocked if the build fails, so nobody has to wait at the screen.
  • In Bitbucket Cloud, can the pull request author's approval help satisfy a two-approval merge check?
    No. The author can approve their own pull request, but that approval does not count toward the minimum number of approvals, so two approvals from other users are still needed.

  • Selecting a minimum-approvals check blocks merges on every Bitbucket plan.
  • The pull request author's own approval counts toward the minimum approvals.
  • Branch permissions alone can require two approvals before merging.
  • Approvals are always cleared automatically when the author pushes new commits.
  • A merge check configured on main also applies to pull requests into develop.
open as a page

In Bitbucket Cloud linked to Jira, why might a commit message like ACME-142 #resolve leave the Jira work item unchanged?

level: middleimportance: must knowfreq 30%

basics

~20 s

A Bitbucket Cloud smart commit runs as the Jira user whose email matches the commit's author email. A mismatched email, missing permission, required transition fields, a malformed key or disabled smart commits stops it; the commit still lands.

open as a page

In Bitbucket Cloud, how do workspaces, projects and repositories relate, and where can access to a repository be granted?

level: juniorimportance: should knowfreq 28%

basics

~20 s

A Bitbucket Cloud workspace owns the repositories, members and user groups; projects group repositories inside it. Access is granted at three levels: workspace user groups, project permissions covering every repository in the project, and permissions on one repository.

open as a page

In Bitbucket Cloud branch permissions, how does Write access differ from Merge access via pull requests when you restrict main?

level: middleimportance: should knowfreq 24%

basics

~20 s

In a Bitbucket Cloud branch restriction, Write access names who may push commits straight to the branch; Merge access via pull requests names who may merge a pull request into it. Anyone given write access automatically gets merge access too.

open as a page

In Bitbucket Cloud, how do the six pull request merge strategies differ in the history they leave on the destination branch?

level: middleimportance: should knowfreq 20%

basics

~20 s

Bitbucket Cloud offers Merge commit, Fast forward, Rebase, merge, Rebase, fast-forward, Squash and Squash, fast-forward only. They differ in whether a merge commit is added, whether source commits stay separate or are combined, and whether an out-of-date branch is refused.

open as a page

In Bitbucket Cloud, how would you make one project enforce main protection, two approvals and a merge strategy across forty migrated repositories?

level: seniorimportance: should knowfreq 13%

basics

~20 s

Define it once on the Bitbucket Cloud project: permissions, a main branch restriction with merge checks, default reviewers and a merge strategy. Permissions and restrictions reach every repository; moved repositories must be switched to inherit the merge strategy.

open as a page