惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Stack Overflow Blog
Stack Overflow Blog
N
News | PayPal Newsroom
阮一峰的网络日志
阮一峰的网络日志
月光博客
月光博客
T
Tailwind CSS Blog
博客园 - 叶小钗
博客园 - 【当耐特】
Apple Machine Learning Research
Apple Machine Learning Research
B
Blog RSS Feed
Know Your Adversary
Know Your Adversary
P
Privacy International News Feed
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Project Zero
Project Zero
美团技术团队
雷峰网
雷峰网
Martin Fowler
Martin Fowler
P
Privacy & Cybersecurity Law Blog
T
The Blog of Author Tim Ferriss
S
Schneier on Security
V
V2EX
Cisco Talos Blog
Cisco Talos Blog
Blog — PlanetScale
Blog — PlanetScale
G
GRAHAM CLULEY
J
Java Code Geeks
V
Visual Studio Blog
N
Netflix TechBlog - Medium
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Cyberwarzone
Cyberwarzone
Recent Announcements
Recent Announcements
C
CXSECURITY Database RSS Feed - CXSecurity.com
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
N
News and Events Feed by Topic
Forbes - Security
Forbes - Security
GbyAI
GbyAI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Hacker News
The Hacker News
Application and Cybersecurity Blog
Application and Cybersecurity Blog
The Cloudflare Blog
腾讯CDC
爱范儿
爱范儿
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
罗磊的独立博客
T
Threatpost
大猫的无限游戏
大猫的无限游戏
NISL@THU
NISL@THU
Cloudbric
Cloudbric
C
CERT Recently Published Vulnerability Notes
C
Check Point Blog
Microsoft Azure Blog
Microsoft Azure Blog

Graphite blog

Introducing Code Tours: a new way to review Introducing Cursor Cloud Agents in Graphite Building the future of software development with Cursor Reimagining the PR Page: Designing for speed and focus Graphite changelog [11-20-2025] Graphite changelog [11-04-2025] Graphite changelog [10-16-2025] The future of engineering is collaborative (and already here) Meet Graphite Agent: the next evolution of AI code review Introducing frozen branches: A safer way to build on your teammates’ work Graphite changelog [09-17-2025] How we sped up code search for Graphite Chat Introducing Graphite Chat AI is writing code—here's why it also needs to review that code How I got Claude to write code I could actually ship How we built the first stack-aware merge queue (and why it matters) How we organize our monorepo to ship fast Graphite brings stacking to Tower Code review tooling: Should you build or buy? Making AI code review available to everyone Introducing: The new Graphite + Linear integration Graphite raises $52M and launches Diamond to reimagine code review for the age of AI Why AI will never replace human code review How stacked PRs unblock distributed development teams Graphite is going to Developer Week 2025 Beating the end of year code freeze How Graphite’s eng team ships code remarkably fast Why we chose Anthropic's Claude to power Graphite Reviewer AI code generation will remain fragmented How we redesigned Graphite's landing page in-house Introducing Graphite Reviewer: your AI code review companion How AI code review reduces review cycles to improve developer productivity What if you could get instant feedback on your code? The new developer toolchain Not Rocket Science - How Bors and Google’s TAP inspired modern merge queues Graphite's State of code review 2024 How Google migrated billions of lines of code from Perforce to Piper Going from 0 to 1: How to write better unit tests when there are none Speed up your merges: Parallel CI is now generally available for teams using Graphite’s merge queue Down for less than four minutes a month: how AWS deploys code BitKeeper, Linux, and licensing disputes: How Linus wrote Git in 14 days Graphite is now free for startups and open source projects Launch week wrap-up (May 2024) Reduce CI costs for Buildkite and GitHub Actions Cheaper CI & faster merging with batching How Google does code review The technical learning curve at a startup is gentler than you might think Graphite will now automatically rebase your partially-merged stacks Multiple engineers can now seamlessly collaborate on the same stack of PRs Do you ever outgrow GitHub? From the 80's to 2024 - how CI tests were invented and optimized Graphite changelog [4/10/2024] 🎺 Graphite changelog [4/25/2024] 🐸 How Stack Overflow replaced Experts Exchange How GitHub monopolized code hosting Graphite changelog [3/27/2024] 🤝 The core principles of building a good AI feature Onboarding roulette: deleting our employee accounts daily Graphite changelog [3/13/2024] 🚁 Why Facebook doesn’t use Git How to recreate the Phabricator code review workflow Types of code reviews: Improve performance, velocity, and quality What's the best GitHub pull request merge strategy? Phabricator vs GitHub vs Graphite: How do they stack up? Improving team velocity through better pull request practices Moving fast breaks things: the importance of a staging environment Building trust as a software engineer Keeping code simple: moving fast by avoiding over-engineering What's better than GitHub pull request filters? The Graphite pull request inbox 7 Best Phabricator alternatives for PR stacking + code review [2024] Accurate eng estimations: predicting and negotiating the future Tracking and understanding GitHub PR stats: A step-by-step guide 8 pull request best practices for optimal engineering What’s next for Graphite Graphite Q1 Launch week: Stacking with the tools you love Graphite Q1 Launch week: Making stacking seamless Accelerating code review The Mom Test Graphite Q1 launch week 2024 The practical and philosophical problems with AI code review Empirically sup code review best practices Call site attribution: how to pinpoint rogue SQL queries throttling your performance Every engineer should understand git reflog Post mortem: we took 124 seconds from you, here's 378 back Your GitHub pull request workflow is slowing everyone down Optimizing CI/CD workflows for trunk-based development Why we use AWS instead of Vercel to host our Next.js app How large pull requests slow down development 3 key lessons in application server optimization Trunk-based development: why you should stop using feature branches Git was built in 5 days Why large companies and fast-moving startups are banning merge commits How long should your CI take? Experimenting with AI code review CRA to AppRouter in 5 Steps: A case study with Graphite Graphite Changelog [10/18/2023] The comprehensive guide to writing the best PR title of all time How 10,000 Developers All Contribute to the same Repo
How to use stacked PRs to unblock your entire team
Ninad Pathak · 2024-01-09 · via Graphite blog

Imagine this—you just finished a massive feature. Hundreds of lines of code across dozens of files. You changed the database, the frontend, and the server logic. You finally submit the huge pull request (PR) for review and... you're blocked. You can’t move on to the next critical task until this mega PR gets reviewed and merged.

So you're stuck with two bad options:

1.  Switch to a low-priority task from the backlog, stalling momentum.

2.  Repeatedly ping your coworkers, begging for a faster review.

This isn’t a hypothetical problem; it’s the reality for teams stuck with monolithic pull requests. But there’s a better way. The best engineering teams at companies like Meta have used stacked PRs for years to accelerate their development. Stacking unblocks you by splitting large changes into small, manageable PRs that you can build on top of each other.

Once you experience an unblocked workflow, you'll never go back. Let's dig into how stacking works and why it’s the new standard for high-performance teams.

What is stacking, and how does it work?

Stacked pull requests are like building with LEGOs. You start with a solid foundation—the main branch. On top of this, you add your first piece: a small, focused code change. While that first piece is being reviewed, you can start adding the second. Each piece builds on the last, allowing you to construct something complex without waiting for approval at every step.

That’s the core idea of stacking: break large features into a series of tiny, dependent pull requests. Each small PR can be tested, reviewed, and merged independently, completely unblocking you from the code review process.

To put things in perspective, let’s take an example of an e-commerce checkout flow. Instead of a single large PR with hundreds of lines of code, you can break the checkout flow into several smaller PRs:

  • PR 1: Add the checkout button UI.

  • PR 2: Build the checkout form fields. 

  • PR 3: Integrate the payment gateway.

  • PR 4: Handle order submission and completion

You can work on each component without waiting for reviews. PR 2 is branched off PR 1, PR 3 is branched off PR 2, and so on. This eliminates the need to wait for code to merge to main before you can build the next part of the feature.

Because the PRs are small, reviews are faster and more thorough. This gets your code merged with fewer bugs and less delay.

Why you can’t go back: the benefits of stacking

Adopting a stacked PR workflow provides key advantages that let you ship faster. Once you experience these benefits, the old way of doing things feels impossibly slow.

Fully unblocked dev workflows

With a stacked PR workflow, you open your first PR with a small change, submit it for review, and immediately start the next branch on top of it. This approach eliminates development bottlenecks and ensures an uninterrupted workflow. You stay focused on building, not waiting.

For our e-commerce example:

  • Your first PR implements just the checkout button.

  • The next PR builds the form elements.

  • The third handles order processing.

At each step, you continue building without waiting for approvals. You’re no longer blocked for hours or days on a 1,000-line PR.

Easier debugging

Debugging is simpler when you isolate changes. If your giant, all-in-one PR breaks the payment gateway, good luck digging through hundreds of edits across 20 files to find the cause.

With stacked PRs, any issue is almost certainly in the last small change you made. Since each PR is under 200 lines, it's easy to find what went wrong and revert it. Instead of one huge change that breaks your entire checkout flow, you have small, incremental components that make identifying and fixing issues simple.

Quicker, more thorough reviews

Let's be honest: nobody wants to review a 1,000-line pull request. They often get delayed or rubber-stamped.

With stacking, reviews become focused and efficient. Reviewers can easily understand the scope when a PR touches five files instead of 50, leading to faster and higher-quality feedback. In a stacked world, you'd have a separate PR for the checkout button, the form UI, and the order processing logic—each is much simpler to digest, which cuts down the overall review time.

How to implement the stacking workflow for your team

Moving to a stacked workflow can be a change, but once your team gets the hang of it, the productivity gains are significant. Developers stay focused on writing code, not waiting for reviews.

The transition requires some teamwork. Here's how to start:

1.  Assess your team's trunk-based development maturity: Ensure developers are comfortable with concepts like rebasing, short-lived branches, and rapid integration.

2.  Get buy-in by communicating benefits: Show how stacking solves real pain points like review delays and merge conflicts.

3.  Define team-wide standards: Align on expectations for PR size (<200 lines of code) and review turnaround times (<24 hours).

Integrating a tool built for stacking can make the transition much faster. Graphite helps your team create and manage stacks from the command line while automating the complexity behind the scenes.

Stacking workflow with GitHub vs Graphite

While you can technically stack PRs with just GitHub, the workflow is manual and error-prone. To see the difference, let's build a "dark mode" feature broken into a parent PR and two dependent children.

The GitHub workflow (the hard way)

First, create the initial parent PR:

// Start point is main branch

git checkout -b dark-mode-toggle

// Implement toggle UI component, then add the file.

git add DarkModeToggle.js

git commit -m "Feature: Add dark mode toggle UI"

// Creates PR

git push -u origin dark-mode-toggle

Next, you stack two child PRs on top, one for styles and one for transitions.

// Checkout the parent PR

git checkout dark-mode-toggle

// Create the child PR

git checkout -b dark-mode-styles

// Implement the dark mode styles and styling elements

git add DarkModeStyles.css

git commit -m "Feature: Styling dark mode"

git push origin dark-mode-styles

// Create second child PR

// while you’re checked out on dark-mode-styles (first child)

git checkout -b dark-mode-transitions

// Implement the transitions

git add DarkModeTransitions.js

git commit -m "Feature: Add theme transitions"

git push origin dark-mode-transitions

This manual process creates immediate problems. If a reviewer requests a change on the parent branch (`dark-mode-toggle`), you have to manually rebase every single child branch to propagate the update.

// Checkout the parent branch

git checkout dark-mode-toggle

// Reviewer comments on the parent branch

// You make changes and push code to the parent branch

git add DarkModeToggle.js

git commit -am "BugFix: Fix padding based on feedback"

git push origin dark-mode-toggle

// You now need to make upstream changes

// Manually rebase child branches on updated parent

git checkout dark-mode-styles

git rebase dark-mode-toggle

// Rebase the second child and continue doing so for all branches

git checkout dark-mode-transitions

git rebase dark-mode-styles

The GitHub workflow is tedious. You're responsible for:

  • Constant, manual rebasing.

  • Resolving merge conflicts across a long chain of branches.

  • Manually tracking all the dependencies.

This overhead distracts from writing code. Now let's see how Graphite automates this.

Stacking PRs with Graphite

With the Graphite CLI, you just create branches and let it manage the dependencies. After installing it and navigating to your repo, you can create your first branch.

// Modify your files since the next command will

// create a new branch with your changes off of the branch

// you’re currently at

gt create -am "Feature: Add dark mode toggle UI"

This command creates a new branch and commits your staged changes. To stack the next part of the feature, you just run the command again. Graphite automatically stacks the new branch on top of your current one.

// Make changes while you’re on the toggle UI branch

// Then run the below command to create a new child branch with the changes

gt create -am "Feature: Styling dark mode"

When you need to address feedback on the parent branch, a single `gt modify` command updates the branch and automatically restacks all its children. No manual rebasing is required.

// Checkout the branch that received review comments

// Make changes to the required files and then

// run the following command

$ gt modify -a

[01-04-Feature_Add_dark_mode_toggle_UI f24cf74] Feature: Add dark mode toggle UI

1 file changed, 1 insertion(+)

Restacked 01-04-Feature_Styling_dark_mode on

01-04-Feature_Add_dark_mode_toggle_UI.

Restacked 01-04-Feature_Add_theme_transitions

on 01-04-Feature_Styling_dark_mode.

When you're ready to submit, `gt submit` bundles the entire stack, handles pushing to the remote, and opens all the PRs with the correct dependencies.

$ gt submit

🥞 Validating that this Graphite stack is ready to submit...

✔ How would you like to proceed? > Continue with empty branches

✏️ Preparing to submit PRs for the following branches...

▸ 01-04-Feature_Add_dark_mode_toggle_UI (Create)

✔ Title ... Feature: Add dark mode toggle UI

✔ Body > Skip (leave empty)

✔ Submit > Create Draft Pull Request

▸ 01-04-Feature_Styling_dark_mode (Create)

✔ Title ...

✔ Body > Skip (leave empty)

✔ Submit > Create Draft Pull Request

▸ 01-04-Feature_Add_theme_transitions (Create)

✔ Title ...

✔ Body > Skip (leave empty)

✔ Submit > Create Draft Pull Request

📨 Pushing to remote and creating/updating PRs...

The CLI prints out URLs for the new PRs, and Graphite even allows reviewers to merge dependent branches automatically. The entire process is streamlined.

The difference is clear. GitHub requires you to manually manage every dependency and rebase. Graphite automates the coordination, which lets you focus on your code instead of Git mechanics.

Ready to unblock your team and achieve peak productivity?

Stacked pull requests are a fundamental improvement over monolithic PRs. They unblock developers, improve code quality, and lead to faster innovation. By removing the bottleneck of massive pull requests, your team can achieve a state of flow and productivity.

Ready to leave monolithic PRs behind? Install the CLI and start stacking in minutes.