Skip to content

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.


List commits, newest first.

Terminal window
bb commit list [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)
Terminal window
# Inside a git repository: history of the current branch
bb commit list
bb commit list --ref main
bb commit list --ref v1.0.0 --limit 50
# → { workspace, repoSlug, [ref], count, commits }
bb commit list --json
# Hashes only, via built-in --jq
bb 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.
  • --limit is enforced across paginated responses. When results are capped the CLI prints Showing 25 commits. Use --limit <n> or --all to see more. (suppressed with --json).
  • An unknown --ref returns Ref 'no-such-branch' not found in acme/api. Pass --ref <branch|tag|sha> to choose a different ref.

View the full details of a single commit. <sha> is a full or abbreviated hash.

Terminal window
bb commit view <sha> [options]
Terminal window
bb commit view abc1234
# → { workspace, repoSlug, commit }
bb commit view abc1234 --json
# Raw author string of the commit
bb 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 --json mode, commit is 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.