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.
How this command is triggered — by the user, by Claude, or both
Slash command
/git:backport <commit> <branch1> [branch2...] [--new-branch]The summary Claude sees in its command listing — used to decide when to auto-load this command
## Name git:backport ## Synopsis ## Description 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: - Automated commit backporting to one or multiple branches - Validation of commit and branch existence - Safe state management (saves and restores current branch) - Conflict detection and user-guided resolution - Optional new branch creation for PR workflows - S...
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)npx claudepluginhub cblecker/ai-helpers --plugin git/split-branchSplits current git branch into single-commit branches with semantic names generated from commit messages. Optional base-branch argument; confirms names before creating.