Help backport PRs to release branches using the backport CLI tool. Use when backporting changes that have merge conflicts requiring manual resolution.
Help the user backport pull requests to older release branches, especially when conflicts need resolution.
Always pass --no-browser to prevent the backport tool from opening browser
windows. If --no-browser is not recognized, the user has an old version of the
tool — upgrade it by running go install github.com/cockroachdb/backport@latest
and retry.
Basic Usage:
backport --no-browser <pull-request>... # Backport entire PR(s)
backport --no-browser <pr> -r <release> # Target specific release (e.g., -r 23.2)
backport --no-browser <pr> -b <branch> # Target specific branch (e.g., -b release-23.1.10-rc)
backport --no-browser <pr> -j "justification" # Add release justification
backport --no-browser <pr> -c <commit> -c <commit> # Cherry-pick specific commits only
backport --no-browser <pr> -f # Force operation
Conflict Resolution:
backport --continue # Resume after resolving conflicts
backport --abort # Cancel in-progress backport
Common Examples:
backport --no-browser 23437 # Simple backport
backport --no-browser 23437 -r 23.2 # To release-23.2 branch
backport --no-browser 23437 -j "test-only changes" # With justification
backport --no-browser 23437 -b release-23.1.10-rc # To specific release candidate branch
When the user specifies exact release branches, use those directly. When the user says something like "backport to all branches" or "backport to all supported releases" without listing specific versions, determine which branches are still supported by fetching the CockroachDB release support policy page: