Every developer knows the pain of waiting for a massive pull request (PR) to be reviewed.
You build Feature A. While waiting for your teammates to review it, you start working on Feature B, which relies on Feature A. Soon, you find yourself stuck in a high-stakes balancing act: either block your own progress until the first PR lands, or merge Feature B into Feature A, creating a giant, unreviewable monster PR.
Enter Stacked Pull Requests (Stacked PRs)—a modern development strategy designed to keep developer velocity high and code reviews bite-sized. With GitHub introducing native support and improved workflows for stacked PRs, shipping incremental code changes has never been smoother.
What is a Stacked Pull Request?
A Stacked PR is the practice of breaking down a complex feature into a chain of smaller, dependent pull requests that build on top of one another.
Instead of opening one massive PR with 2,000 lines of code changes, you open a series of smaller branches:
PR #1 (Base): Database schema updatesPR #2 (Stacked on #1): Core backend logic & API routesPR #3 (Stacked on #2): Frontend UI integration
Each pull request targets the branch right below it in the stack. Once PR #1 is approved and merged into main, PR #2 automatically updates its target branch to main, keeping the review chain moving without friction.
Why Stacked PRs Change the Game for Teams
1. Unblock Engineering Velocity
You no longer need to wait for a code review before moving on to the next dependent task. Developers can keep building on top of their own branches sequentially while reviews happen asynchronously.
2. Faster, High-Quality Code Reviews
Reviewing 150 lines of focused code takes 5 minutes; reviewing 1,500 lines takes hours (and usually results in superficial "looks good to me" approvals). Smaller PRs lead to higher-quality feedback, better bug detection, and faster turnaround times.
3. Safer Deployments & Easier Rollbacks
If an issue arises in production, rolling back a small, isolated PR is significantly safer than reverting a multi-thousand-line release.
How to Work with Stacked PRs: The Ideal Workflow
While the concept is straightforward, managing dependent git branches requires discipline:
Keep Branches Hyper-Focused: Limit each layer of the stack to a single logical change or component.
Set Up Clean Target Branches: When creating
PR #2, set its base branch tofeature/part-1instead ofmain.Automate Rebases: When changes are requested on
PR #1, rebase down the chain (PR #2andPR #3) so that downstream branches remain up to date.Merge from the Bottom Up: Always merge the foundational branch first to avoid merge conflicts across the stack.
The Verdict: Smaller PRs, Faster Delivery
Stacked pull requests shift the engineering mindset from infrequent, massive drops to continuous, incremental flow. By adopting a stacked workflow, your team reduces reviewer fatigue, eliminates development bottlenecks, and keeps the CI/CD pipeline moving effortlessly.
If you haven't tried stacking your PRs yet, start with your next multi-step feature—your code reviewers will thank you!
Have you started using Stacked PRs in your day-to-day workflow? What tools or CLI extensions (like gh-stack or Graphite) are you using to manage them? Let's discuss in the comments below!
Comments
Post a Comment