/git-plugin:git-commit-push-pr [remote-branch] [--push] [--direct] [--pr] [--draft] [--issue <num>] [--no-commit] [--range <start>..<end>] [--skip-issue-detection]from git-plugin
End-to-end workflow from uncommitted changes to an open PR. Auto-detects issues, commits, pushes, and creates pull requests in one step.
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.
Read when SKILL.md points to them.
| Use this skill when... | Use X instead when... |
|---|---|
| Going from uncommitted changes to an open PR in one step | Creating commits only with no push or PR (/git:commit) |
| Auto-detecting issues, committing, pushing, and opening a PR together | Pushing existing commits to a remote without opening a PR (/git:push) |
| Running the full commit-push-PR pipeline non-interactively | Opening a PR from already-pushed commits (/git:pr) |
find . -maxdepth 1 -name ".pre-commit-config.yaml"git branch --show-currentgit status --porcelain=v2 --branchgit diff --numstatgit diff --cached --numstatgit log --format='%h %s' --max-count=10git remote -vAvailable labels and open issues are fetched during execution (requires a configured git remote).
Parse these parameters from the command (all optional):
$1: Remote branch name to push to (e.g., feat/auth-oauth2). If not provided, auto-generate from first commit type. Ignored with --direct.--push: Automatically push after commits--direct: Push current branch directly to same-named remote (e.g., git push origin main). Mutually exclusive with --pr.--pr / --pull-request: Create pull request after pushing (implies --push, uses feature branch pattern)--draft: Create as draft PR (requires --pr)--issue <num>: Link to specific issue number (requires --pr)--no-commit: Skip commit creation (assume commits already exist)--range <start>..<end>: Push specific commit range instead of all commits--labels <label1,label2>: Apply labels to the created PR (requires --pr)--skip-issue-detection: Skip automatic issue detection (use when --issue is provided or for trivial changes)IMPORTANT: Execute all steps continuously without pausing to ask for confirmation between steps. This is a complete workflow — commit, push, and PR creation flow as a single operation. Do not stop after committing to ask whether to push or create a PR; proceed through all applicable steps.
--direct: any branch is valid, stay on current branchfix/handle-timeout-edge-case, feat/add-oauth-support). Use git checkout -b <branch-name>.Follow references/issue-detection.md to match the staged changes against open issues and pick Refs for the commit (Step 3) and Fixes / Closes / Refs for the PR body (Step 5b).
git add -u for modified files, git add <file> for new filespre-commit rungit add -uRefs #N:
Fixes #N there closes the issue when the commit lands on the default branch, whatever the PR body says, and under squash with COMMIT_MESSAGES every branch commit message lands in the squash body. The closing keyword goes in the PR body (Step 5b); the no-closing-keywords commit-msg hook rejects it in a commit.Refs #N):
Keyword catalogue (closing, reference-only, cross-repo, multiple issues): references/workflow-guidance.md.If --direct: Push current branch to same-named remote:
# Direct push to current branch
git push origin HEAD
Otherwise (feature branch — created in Step 1 or pre-existing):
# Push the current feature branch and set upstream
git push -u origin $(git branch --show-current)
5a. Identify post-merge follow-up actions.
Before creating the PR, scan commit messages, diff context, and any conversation context for actions that must happen after the PR is merged:
| Signal | Examples |
|---|---|
| Commit messages | "migration", "run after deploy", "manual step", "update config" |
| File patterns | *.sql, migration files, deployment scripts, runbooks |
| Context | User mentioned a deployment step, documentation update, or announcement |
For each post-merge action identified, create a GitHub issue — not a PR checklist item. PR descriptions are closed and buried once a PR merges; issues remain open until resolved.
Write the follow-up body to a tempfile with the Write tool and pass it via --body-file. Inline --body "..." mangles backticks and multi-line content via shell escaping; see the Body content rule in github-issue-writing.
Example gh issue create --body-file call and common follow-up types: references/workflow-guidance.md.
5b. Create the PR, including follow-up issue links in the body.
Use mcp__github__create_pull_request with:
head: The remote branch name (e.g., feat/auth-oauth2)base: maintitle: Derived from commit messagebody: Include summary, Fixes #N / Closes #N for --issue and for each detected issue the PR fully resolves, and a Follow-up: line plus Refs #N footers for any issues created in 5a (plain prose, no headings or checklists — the body may become a commit body). The MCP tool takes the body as a JSON string parameter — no shell escaping, so backticks and code fences pass through unchanged.draft: true if --draft flag setIf falling back to gh pr create instead of the MCP tool, write the body to a tempfile and pass --body-file /tmp/pr-body.md (see the Body content rule in github-issue-writing).
PR body structure when follow-up issues exist:
The squash body follows the repo's squash_merge_commit_message: COMMIT_MESSAGES uses the branch commits' messages and PR_BODY the PR body; read it with gh api repos/{owner}/{repo} --jq .squash_merge_commit_message rather than assuming. On a PR_BODY repo a squash-merged PR's body becomes the commit body (see github-pr-title →
merge-strategies.md) — prose, then footers:
<1–3 sentence summary of what changed and why>
Follow-up: #456 (database migration), #457 (feature-flag config)
Fixes #123
Refs #456
Refs #457
If --labels provided, add labels after PR creation:
gh pr edit <pr-number> --add-label "label1,label2"
After PR creation, watch CI checks to confirm the PR is ready for merge:
# Watch all checks (not just required — many repos have no required checks configured)
gh pr checks <pr-number> --watch --fail-fast
On success (exit 0):
gh pr merge <pr-number> --<method> --delete-branch, where <method> is the METHOD= that python3 "${CLAUDE_PLUGIN_ROOT}/scripts/pr-merge-method.py" --repo <owner>/<repo> --pr <pr-number> prints (rebase by default; rule table in merge-strategies.md)Before gh pr merge … --delete-branch, switch off the PR's branch: references/workflow-guidance.md.
On failure (exit 1):
gh pr checks <pr-number> --json name,state,bucket,link --jq '.[] | select(.bucket == "fail")'
See references/workflow-guidance.md for pre-commit staging, push modes, unexpected state, and issue-reference formats.
What SKILL.md sets; muted values are Claude Code's defaults
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.Other plugins' skills for the same job