/git:backport <commit> <branch1> [branch2...] [--new-branch]from git
Backports a commit to one or more target branches via cherry-pick, with optional new-branch creation for PR workflows. Validates inputs, handles conflicts, and restores the original branch.
Ships in git. Installing the plugin adds it to Claude Code.
git:backport
/git:backport <commit> <branch1> [branch2...] [--new-branch|-b]
The git:backport command helps backport a commit to multiple branches. It automates the process of cherry-picking a commit to one or more target branches, with optional support for creating new branches for each backport (useful for creating pull requests).
This command provides:
The command executes the following workflow:
Validates inputs:
--new-branch or -b flag if presentgit cat-file -t <commit>git log -1 --oneline <commit>ASK FOR USER PERMISSION:
Saves current state (only after user permission):
git branch --show-currentgit status --porcelainFor each target branch (only after user permission):
git checkout <branch>git rev-parse --abbrev-ref <branch>@{upstream}git pull--new-branch flag is set:
git checkout -b backport-<commit-short-hash>-to-<branch>
backport-abc1234-to-release-1.0git cherry-pick <commit>git statusgit diffgit cherry-pick --continue when done, or git cherry-pick --abort to skipRestores original state:
git checkout <original-branch>--new-branch was used)--new-branch was used, reminds user they can now create PRs from the new branchesThe command is interactive and waits for user input when conflicts occur and REQUIRES USER PERMISSION before executing any git operations. It tracks success/failure for each branch and provides a comprehensive summary at the end.
--new-branch flag was used)Basic backport to a single branch:
/git:backport abc1234 release-1.0
Cherry-picks commit abc1234 directly to the release-1.0 branch.
Backport to multiple branches:
/git:backport abc1234 release-1.0 release-1.1 release-1.2
Cherry-picks commit abc1234 to three different release branches.
Backport with new branch creation (for PRs):
/git:backport abc1234 release-1.0 release-1.1 --new-branch
Creates new branches backport-abc1234-to-release-1.0 and backport-abc1234-to-release-1.1, each containing the cherry-picked commit. These branches can then be used to create pull requests.
Using short flag syntax:
/git:backport abc1234 main -b
Same as --new-branch, creates a new branch backport-abc1234-to-main.
--new-branch or -b: Create a new branch from each target branch before cherry-picking (optional flag)What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
npx claudepluginhub openshift-eng/ai-helpers --plugin git10 commands in this plugin
/bisectNameInteractive git bisect assistant with pattern detection and automation/branch-cleanupNameClean up old and defunct branches that are no longer needed/cherry-pick-by-patchNameCherry-pick git commit into current branch by "patch" command/commit-suggestNameGenerate Conventional Commits style commit messages or summarize existing commits/debt-scanNameAnalyze technical debt indicators in the repository/fix-cherrypick-robot-prNameFix a cherrypick-robot PR that needs manual interventionOther plugins' commands for the same job