A GitHub CLI extension to apply a pull request to the current branch.
gh extension install 134130/gh-cherry-pickApply a merged pull request to the branch you are currently on:
gh cherry-pick 123By default, the command prints a plan and asks for confirmation before mutating
Git. For automation, pass --yes:
gh cherry-pick 123 --yesPreview the plan without applying it:
gh cherry-pick 123 --dry-run
gh cherry-pick 123 --dry-run --json| Flag | Default | Description |
|---|---|---|
--method |
auto |
Apply method: auto, patch, commits, squash, or merge |
--dry-run |
false |
Print the plan without applying it |
--yes, -y |
false |
Apply without interactive confirmation |
--format |
human |
Output format: human or json |
--json |
false |
Shortcut for --format json |
--no-color |
false |
Disable ANSI color |
--verbose, -v |
false |
Print command/progress details |
| Method | Behavior |
|---|---|
auto |
Infer a concrete method from PR metadata |
patch |
Apply gh pr diff <pr> --patch with git am -3 |
commits |
Cherry-pick each PR commit in order |
squash |
Apply the PR diff and create one commit |
merge |
Cherry-pick a merge commit with -m 1 |