Commit Commands - Inspect Repository History
Inspect commits in a Bitbucket repository — list the history of a branch, tag, or revision, and view the full details of a single commit.
Commit commands operate at repository scope. Run them inside a cloned
Bitbucket repository, or pass -w, --workspace <workspace> and
-r, --repo <repo> explicitly.
Global options available on all commit commands: --json [fields],
--jq <expression>, --no-color, --no-unicode, --no-truncate,
--locale <locale>, -w, --workspace, -r, --repo.
A <sha> is a full 40-character hash or any abbreviated prefix (abc1234).
--json output is wrapped in an envelope keyed by workspace and repoSlug;
the # → comments below show each shape.
bb commit list
Section titled “bb commit list”List commits, newest first.
bb commit list [options]Options
Section titled “Options”| Option | Description |
|---|---|
--ref <ref> |
Branch, tag, or commit SHA to list history for (default: current git branch) |
--limit <number> |
Maximum number of commits (default: 25) |
--all |
List all commits (overrides --limit) |
Examples
Section titled “Examples”# Inside a git repository: history of the current branchbb commit list
bb commit list --ref mainbb commit list --ref v1.0.0 --limit 50
# → { workspace, repoSlug, [ref], count, commits }bb commit list --json
# Hashes only, via built-in --jqbb commit list --json --jq '.commits[].hash'- Default ref: with no
--ref, the CLI uses the current git branch when run inside a git repository. When branch detection fails (outside a git repository, detached HEAD), it falls back to the repository’s default commit listing instead of erroring. - Columns: short hash (7 characters), first line of the commit message
(truncated to 60 characters; disable with
--no-truncate), author (Bitbucket display name, or the name parsed from the raw git author), and commit date. --limitis enforced across paginated responses. When results are capped the CLI printsShowing 25 commits. Use --limit <n> or --all to see more.(suppressed with--json).- An unknown
--refreturnsRef 'no-such-branch' not found in acme/api. Pass --ref <branch|tag|sha> to choose a different ref.
bb commit view
Section titled “bb commit view”View the full details of a single commit. <sha> is a full or abbreviated hash.
bb commit view <sha> [options]Examples
Section titled “Examples”bb commit view abc1234
# → { workspace, repoSlug, commit }bb commit view abc1234 --json
# Raw author string of the commitbb commit view abc1234 --json --jq '.commit.author.raw'- The human view shows the full hash, author (raw
Name <email>when available), date, parent commits (short hashes), and the complete commit message including the body. - In
--jsonmode,commitis the raw commit resource as returned by the Bitbucket API (hash, author, parents, message, links, …). - An unknown sha returns
Commit abc1234 not found in acme/api.
See also
Section titled “See also”- Status Commands — read and report build statuses on commits.
- Scripting & Automation — JSON envelopes,
--jq, exit codes.