Github Stacked PR
🎯 What a “Stacked PR” Is (and Why You’ll Want One) A stacked pull request (sometimes called a stacked PR , stacked diff , or dependent PR ) is a series of PRs that build on top of each other, each one containing a small, logically‑isolated change. main ──► A ──► B ──► C │ │ │ │ │ └─ PR‑C (depends on B) │ └─ PR‑B (depends on A) └─ PR‑A (directly on main) A is based on main . B is based on A (its head). C is based on B , etc. When you eventually merge the stack in order (A → B → C), each change lands cleanly, and reviewers can focus on one cohesive piece at a time. Why Stack PRs? Problem Stacked PR Solution Huge, monolithic PRs that are hard to review & cause long CI times Break the work into bite‑size PRs (e.g., “feature flag”, “data model”, “UI”) Inter‑dependent changes (e.g., a new API + its consumer) Each dependent change lives in its own PR, but they still get tested together because they are built on top of each other Rebasing on main constantly drags in unrelated changes Only the bottom PR needs to be rebased onto main ; the rest stay on top of it Need to ship part of a larger change early Merge the first PR in the stack; the rest stay pending until they’re ready CI resources Only the bottom PR runs the full suite against main ; higher PRs can run a lighter subset because they already passed lower‑level tests 📦 The Landscape of Tools (as of 2026) Tool / Service Key Features Installation / Setup Typical Workflow ghstack (GitHub CLI plugin) - Creates stacked PRs automatically from a series of commits. - Handles base‑branch updates, resolves merge conflicts, and can re‑stack after rebases. - Works with GitHub's GraphQL API, so you get “dependent PR” links in the UI. pip install ghstack (or brew install ghstack ). Requires a personal access token with repo scope. bash git checkout -b feature/stacked\n# create many commits …\nghstack push\n# later, after rebasing on main\nghstack rebase . | | GitTown (aka git-town ) | - git town ship can ship a stack of dependent br