NEWS / 0183

AI & ML

GitHub Introduces Stacked Pull Requests for Streamlined Code Review

Published
Aug 03, 2026
Views
381

GitHub's new feature for stacked pull requests promises to enhance code review efficiency by breaking changes into manageable layers, improving workflows.

GitHub Introduces Stacked Pull Requests for Streamlined Code Review

Stacked Pull Requests Now a Native Feature on GitHub

For years, the concept of stacked pull requests has circulated in software engineering circles, largely as a practice implemented by teams at companies like Meta and Google, while open source developers have made do with tools like ghstack. This week, GitHub announced that stacked pull requests are being added as a native feature, currently in public preview and set to roll out to all repositories shortly.

Understanding the Stacking Mechanics

The fundamental premise of stacking is straightforward: developers split a large feature into a sequence of smaller pull requests (PRs), with each PR depending on the one before it. This structure allows individual reviews of smaller increments of change, rather than drowning in extensive diffs that can stretch for hundreds or even thousands of lines. For instance, a schema update can serve as the base layer, followed by layered additions of business logic, and culminating in user interface modifications.

The Impacts on Code Review Efficiency

This method isn’t merely a change in how developers organize their work; it directly addresses significant patterns in code review efficiency. Research indicates review quality declines as PR size escalates. Analyzing 1.5 million requests revealed that PRs under 200 lines are approved approximately three times quicker than their larger counterparts, which also exhibit around 40% fewer defects. Each extra 100 lines increases review time by nearly 25 minutes, with issues becoming harder to catch as PR length surpasses 1,000 lines.

According to Mitch Ashley, VP at The Futurum Group, “Review capacity sets delivery pace on most teams. Breaking that change into ordered layers lets a reviewer verify the schema before judging the logic built on top of it.”

How GitHub's Stacking Works

GitHub introduces this feature through a new command-line interface extension called gh-stack, which integrates with github.com, the GitHub mobile app, and coding agents like GitHub Copilot via a specific skill. Developers initiate the process with a branch and PR for the foundational change, then stack additional branches and PRs on top, each targeting the preceding layer. This creates a visual stack map for each PR, helping reviewers understand its context without needing to examine the entire stack at once.

The Benefits of Merging Stacked PRs

The real advantage lies in the merging process. When merging the most recent PR in a stack, the latest changes and all unmerged lower layers can be integrated in one go. Teams can choose to merge partial stacks, allowing for lower layers to be incorporated while leaving the upper ones open, automatically updating them against the new base. Since this functionality is built directly into GitHub, existing branch protections, required checks, and merge queues remain effective throughout the workflow.

Real-World Implications for Development Teams

Teams early to adopt this feature are already seeing transformations in their work processes. For example, the Next.js team at Vercel has noted that stacked PRs enable them to deliver larger features while keeping individual changes manageable and easier to review. TED's engineering team emphasizes the benefits of mitigating reviewer overload as AI-assisted coding tools produce significantly larger PRs, thus restoring balance through a more organized stacking method allowing for easier validation of changes.

The Intersection of AI in PR Management

The integration of AI tools in coding raises interesting dynamics about how teams manage large outputs. With coding agents now capable of generating whole features at once, it becomes imperative to have a strategy for segmenting that code into logical units for review. Stacked PRs facilitate turning agency-generated work into a sequence of dependent changes, such as a schema update followed by service logic, ensuring that reviewers can validate the foundational changes before progressing to additional layers.

Ashley insightfully mentions, “Verification debt is what makes small changes worth the extra branches. Teams measuring output by merged volume will keep hiring reviewers to chase machine-speed generation. Engineering leaders have to size work to what a reviewer can hold.”

Evaluating the Future of Stacking on GitHub

The rollout of merge queue support for stacked PRs is ongoing, indicating GitHub’s commitment to refining the feature under actual continuous integration pressure. Companies that have relied on external stacking tools like Graphite will be observing how effectively GitHub can integrate these workflows natively and whether a need remains for specialized solutions.

It’s evident that GitHub is not merely treating the issue of PR size as a team-specific workflow matter but tackles it as a larger productivity and quality challenge. As AI tools enable code generation at greater speeds, the review process itself may prove to be just as critical, if not more so, than the speed of code writing.

Source: Tom Smith · devops.com

Discussion

Sign in to join the discussion.