Command: Git Smart Checkout: Clone pull request...
The GitHub PR Clone feature creates a new pull request by cherry-picking selected commits from an existing PR. It is useful for selective feature adoption, focused review workflows, and moving fixes between target branches.
Tip
This feature is in beta. Feedback, suggestions, and PRs are very welcome.
- Select only the commits you need from a large PR without taking unrelated changes.
- Create focused PRs from larger feature branches for easier review.
- Extract specific bug fixes from feature branches to hotfix branches.
- Build upon another contributor's work by cherry-picking commits into your branch.
- Keep commit history clean by selecting only relevant changes.
- Run
Git Smart Checkout: Clone pull request...from the command palette. - Select the GitHub pull request you want to clone from.
- Choose the target branch where your new PR should be merged.
- Choose the feature branch name for your new PR.
- Review the pre-filled description for the new PR (see Description editor and templates).
- Select the commits to cherry-pick.
- Let the extension create the branch, cherry-pick commits, and create the new PR or draft PR.
When entering a GitHub PR URL, use one for the current repository. URLs for another owner or repository are rejected before any PR data is fetched.
If the source PR cannot be loaded, the extension shows the error and resets Fetch PR Data so you can correct the PR number or retry.
During the cherry-pick process, the extension stashes uncommitted workspace changes, switches to the target branch, pulls the latest changes, creates a feature branch, and cherry-picks the selected commits one by one. Selected commits retain the topological order returned by GitHub, including when multiple commits have identical timestamps.
In a multi-root workspace, the command asks which repository to use each time it runs. Switching repositories refreshes the repository shown in the PR Clone view and all subsequent PR data and Git operations use the newly selected repository.
The new PR also copies labels and assignees from the original PR. These metadata updates are best effort: if GitHub rejects one of them, the new PR is still created and the failure is logged.
The description field is pre-filled so you rarely start from scratch:
- The first line is always a back-reference link to the source PR (
[Cloned from PR #N](...)). - The body of the original pull request is used as the description.
- When the source PR has an empty body, the extension falls back to the repository's pull request template, if it has one. The following locations are checked, and the first match wins:
.github/PULL_REQUEST_TEMPLATE.md,.github/pull_request_template.md,PULL_REQUEST_TEMPLATE.md,pull_request_template.md,docs/PULL_REQUEST_TEMPLATE.md, anddocs/pull_request_template.md.
Use the Edit / Preview toggle above the field to switch between editing the raw Markdown and a rendered Markdown preview, so you can check formatting (headings, lists, task lists, links, code, and quotes) before creating the PR. The description stays fully editable regardless of how it was pre-filled.
When conflicts occur during cherry-picking, you can:
- Resolve conflicts manually and continue.
- Cancel the process and restore the original state.
The process is tracked with a progress notification that remains active throughout initialization and can be safely cancelled at any point. In temporary-worktree mode, cancellation is reported as a normal outcome, and the temporary branch and worktree are cleaned up.
If an in-place clone fails during branch setup, cherry-picking, push, or pull request creation, the extension stops the progress notification, attempts to restore the original branch and stashed changes, removes the temporary feature branch when possible, and re-enables the clone controls.
git-smart-checkout.defaultTargetBranchgit-smart-checkout.prBranchPrefixgit-smart-checkout.useInPlaceCherryPick