/git-plugin:git-upstream-pr --commits abc123,def456 or --branch feat/my-upstream-prfrom git-plugin
Submit PRs to upstream repos from a fork — commit selection, squashing, cross-fork creation. Use when contributing changes upstream or cherry-picking fork commits.
Ships in git-plugin. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Submit clean, atomic PRs to upstream repositories from fork work.
| Use this skill when... | Use something else instead when... |
|---|---|
| Contributing changes back to the upstream repo | Committing to your own fork/repo → /git:commit |
| Cherry-picking fork commits for upstream PR (single or multi-commit, squashing) | Creating a PR within the same repo → /git:pr |
| Fork and upstream are roughly aligned | Fork has substantially diverged from upstream → /git:upstream-pr-diverged (patch-id eligibility, re-derive fallback, scrubbing) |
| Need a clean branch based on upstream/main | Working on a branch already tracking upstream |
git branch --show-currentgit status --porcelain=v2 --branchgit remote -vgit remote -vgit remote -vgit remote -vgit log --oneline --max-count=20git stash listParse these from $ARGUMENTS:
| Parameter | Required | Description |
|---|---|---|
--commits sha1,sha2,... | No | Comma-separated commit SHAs to cherry-pick (interactive selection if omitted) |
--branch name | No | Name for the upstream PR branch (auto-generated if omitted) |
--upstream owner/repo | No | Override upstream repo (detected from remote if omitted) |
--draft | No | Create PR as draft |
--dry-run | No | Show what would happen without making changes |
Execute this fork-to-upstream PR workflow:
git rev-parse --git-dirupstream remote exists (from context)upstream remote:
gh repo view --json parent -q '.parent.nameWithOwner'git remote add upstream https://github.com/<owner/repo>.gitgit fetch upstreamgit stash push -m "upstream-pr: WIP before upstream PR"Report the fork's divergence from upstream:
Fork status:
Upstream: <upstream-repo>
Behind upstream/main: N commits
Ahead of upstream/main: M commits
If --dry-run is set, also show which commits would be selected and stop here.
If --commits provided:
git rev-parse --verify <sha>If --commits not provided:
git log --oneline --format='%h %s (%cr)' upstream/main..HEAD
--branch not provided:
feat(auth): add OAuth -> feat/auth-add-oauth)upstream-pr/<date>git switch -c <branch-name> upstream/main
git cherry-pick <sha1> <sha2> ...
git cherry-pick --continuegit reset --soft upstream/main
git commit -m "<conventional commit message>"
git push -u origin <branch-name>
If --dry-run, show the command without executing.
--upstream or detected remote)origin remote URL)gh pr create \
--repo <upstream-owner/upstream-repo> \
--base main \
--head <fork-owner>:<branch-name> \
--title "<conventional commit title>" \
--body "<PR description>"
Add --draft if the flag was provided.git switch <original-branch>
git stash pop
Upstream PR created:
PR: <url>
Branch: <branch-name>
Commits: N cherry-picked, squashed into 1
Original branch restored: <branch>
| Error | Recovery |
|---|---|
| Cherry-pick conflict | Show conflicted files, reference git-conflicts skill |
| Push rejected | Check if branch already exists on fork; suggest --branch override |
| No upstream remote | Auto-detect from gh repo view --json parent or ask user |
| Upstream/main not found | Try upstream/master; ask user for correct branch name |
| No commits ahead of upstream | Report "Nothing to contribute" and exit |
| Context | Command |
|---|---|
| Divergence check | git rev-list --left-right --count upstream/main...HEAD |
| Commits ahead | git log --oneline --format='%h %s' upstream/main..HEAD |
| Validate SHA | git rev-parse --verify --short <sha> |
| Fork owner | git remote get-url origin | sed -E 's#.*github.com[:/]##; s#\.git$##; s#/.*##' |
| Upstream repo | git remote get-url upstream | sed -E 's#.*github.com[:/]##; s#\.git$##' |
| Cross-fork PR | gh pr create --repo <upstream> --head <fork-owner>:<branch> |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
fork-to-upstream, pr-creation, cherry-pick, commit-squashing, cross-fork
npx claudepluginhub laurigates/claude-plugins --plugin git-plugin52 skills in this plugin
/deadbranchdeadbranch CLI for stale-branch cleanup — dry-run preview, TUI or non-interactive delete, protects main/develop/WIP. Use when asked to clean up branches, prune branches, or remove stale branches./external-pr-trustAuthorship as a precondition of merging — bot vs stranger classification, what a merge executes, the merge-guard hook. Use when bulk-merging PRs, or when a merge is denied for a non-self author./gh-cli-agenticgh CLI commands with JSON output for agents. Use when querying PRs, issues, runs, or repo metadata; inspecting PR checks; fetching failed CI logs; or mapping a github.com URL to an API call./git-api-prGitHub API PR creation without local git. Use when submitting file changes as a PR without local commits — quick fixes, typos, config updates, or bypassing local git state./git-branch-namingBranch names: type prefix (feat/, fix/, chore/), issue number, kebab-case. Use when picking a name for a new branch or setting a repo's branch-naming convention./git-branch-pr-workflowBranch management and PR workflows — git switch/restore, GitHub MCP. Use when creating branches, opening PRs, or working with feature branches.Other plugins' skills for the same job