Archive · DevOps

Bitbucket Cloud: Repositories, Pull Requests and Branch Rules

Set up a Bitbucket workspace so changes reach main only through review.

1 min read

  • Bitbucket Cloud
  • Git 2.39

Bitbucket Cloud (Atlassian) groups repositories into workspaces and projects, and links tightly to Jira.

Getting started:

git clone git@bitbucket.org:acme-workspace/shop-api.git
git switch -c feature/SHOP-142-health-check
git commit -am "SHOP-142 add health check"
git push -u origin feature/SHOP-142-health-check

Putting the Jira key (SHOP-142) in the branch or commit name links the work to the ticket automatically.

Protect main under Repository settings, Branch restrictions:

  • Require a pull request and at least one approval (two for production repos).
  • Require a passing build before merge.
  • Block force pushes and branch deletion.
  • Choose a merge strategy: squash keeps history short, merge commit keeps detail.

Use SSH keys per developer (Personal settings, SSH keys) and enable two-step verification for the workspace. Default reviewers per repository save people from forgetting who should look.