Skip to main content
The cops bitbucket branch commands let you inspect branches in a Bitbucket repository. They call the Bitbucket REST API (/rest/api/1.0).

cops bitbucket branch list

List branches in a Bitbucket repository. Supports optional name filtering.Alias: cops bitbucket branch ls

Usage

cops bitbucket branch list --project <projectKey> --repo <repoSlug> [flags]

Flags

--project
string
required
Bitbucket project key (e.g. MYPROJ).
--repo
string
required
Bitbucket repository slug (e.g. my-service).
--filter
string
default:""
Optional branch name filter. Passes the value as filterText to the Bitbucket API — returns branches whose names contain this string.
--limit
number
default:"50"
Maximum number of branches to return.
--output
string
default:"table"
Output format: table, json, or markdown.
--insecure
boolean
default:"false"
Disable TLS certificate validation. Use only with self-signed certificates in trusted networks.
--profile
string
Override the active config profile.

Output columns

id, name, latestCommit

Examples

cops bitbucket branch list --project MYPROJ --repo my-service
id                           name          latestCommit
───────────────────────────  ────────────  ────────────────────────────────────────
refs/heads/main              main          a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2
refs/heads/release/2026-06   release/2026-06  9f8e7d6c5b4a9f8e7d6c5b4a9f8e7d6c5b4a9f8e
refs/heads/feature/auth      feature/auth  1a2b3c4d5e6f1a2b3c4d5e6f1a2b3c4d5e6f1a2b
Check whether a specific branch exists in a Bitbucket repository. Exits with code 1 if the branch is not found.

Usage

cops bitbucket branch exists --project <projectKey> --repo <repoSlug> --branch <branchName> [flags]

Flags

--project
string
required
Bitbucket project key (e.g. MYPROJ).
--repo
string
required
Bitbucket repository slug (e.g. my-service).
--branch
string
required
Branch name to check (e.g. release/2026-06).
--output
string
default:"table"
Output format: table, json, or markdown.
--insecure
boolean
default:"false"
Disable TLS certificate validation. Use only with self-signed certificates in trusted networks.
--profile
string
Override the active config profile.

Output columns

project, repo, branch, exists

Exit codes

CodeMeaning
0Branch exists
1Branch does not exist

Examples

cops bitbucket branch exists --project MYPROJ --repo my-service --branch release/2026-06
project  repo        branch           exists
───────  ──────────  ───────────────  ──────
MYPROJ   my-service  release/2026-06  true
Use cops bitbucket branch exists in release pipelines to verify that a release branch has been cut before proceeding.

cops bitbucket repo

Fetch repository details.

cops bitbucket pr

List pull requests and run PR readiness checks.

Build docs developers (and LLMs) love