pr-followup-commit-stranded-after-squash

Diagnose and recover follow-up commits stranded on a branch after GitHub squash-merge.

3|Updated May 8, 2026
One-click install
npx skills add https://github.com/wan-huiyan/agent-traffic-control --skill pr-followup-commit-stranded-after-squash-wan-huiyan
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: pr-followup-commit-stranded-after-squash
Source: https://github.com/wan-huiyan/agent-traffic-control/tree/main/plugins/agent-traffic-control/skills/pr-followup-commit-stranded-after-squash
Command: npx skills add https://github.com/wan-huiyan/agent-traffic-control --skill pr-followup-commit-stranded-after-squash-wan-huiyan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When you push iterative commits to an open PR and the user squash-merges it mid-iteration, GitHub only captures the commits present at merge time — your later commits silently never reach main. The PR shows MERGED, nothing errors, but main is missing your work. ## Core Features & Use Cases - Diagnosis checklist: Confirms the failure mode using gh pr view --json state, git show --stat insertion counts, and git log range comparisons between the closed branch and main. - Recovery recipe: Branch off current main, cherry-pick the stranded commits in order, and open a follow-up PR with a pre-filled body template explaining what was missed. - Prevention protocol: Verify PR state with gh pr view <num> --json state before every push to an open-PR branch, plus guidance on rebase-merge vs squash-merge tradeoffs. - Rebase hazard warning: Documents why git rebase --onto across a squash-merged boundary can silently drop commits, and mandates the branch-fresh-plus-cherry-pick pattern instead. - Use Case: You pushed commit 1, opened a PR, then pushed commits 2 and 3 responding to feedback — only to discover the PR was already squash-merged with just commit 1. This Skill walks you through recovering commits 2 and 3 onto main via a follow-up PR. ## Quick Start Check whether my follow-up commits on the closed PR branch made it into main after the squash-merge, and if not, help me cherry-pick them into a new follow-up PR.

Frequently Asked Questions about pr-followup-commit-stranded-after-squash

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I recover commits missing after a GitHub squash merge?▼

Fetch with --prune, list stranded commits via git log origin/main..<closed-branch>, then branch off current main and cherry-pick them in order. Push the new branch and open a follow-up PR describing what the squash missed.

Why did my squash merge only include the first commit?▼

GitHub squash-merge captures the branch state at the exact moment of merge, not everything ever pushed. Commits pushed after the merge click land on a closed branch and are never replayed onto main.

How can I prevent commits from being stranded by squash merge?▼

Run gh pr view <num> --json state before every push to an open-PR branch and stop if it shows MERGED. Alternatively batch all iterations into one push, or ask the user to hold the merge while you iterate.

Is git rebase --onto safe after a squash merge?▼

No. Across a squash-merged boundary, git rebase --onto has been observed to silently drop new commits while reporting success. The safe pattern is branching fresh from the base and cherry-picking the commits explicitly.

Does deleting the PR branch lose my stranded commits?▼

Remote branch deletion via gh pr merge --delete-branch does not remove your local copy. Your local closed branch retains the stranded commits, which is the source you cherry-pick from during recovery.