Agents don’t just help build features. They can help try to break them, too.
In our latest GitHub Podcast episode, Sameen Karim takes us behind the scenes on building stacked PRs. Listen to it wherever you get your podcasts or at https://t.co/sCyRjdnHU5
One of the key design decisions we made with stacked PRs was reusing the existing PR model. It definitely came with some drawbacks, but it’s what made it possible to ship the feature without needing to rewrite all of the core plumbing (and we still had to update a lot!)
More on how we built stacks on the latest episode of the @github podcast: https://t.co/eUBCffdAGP
stacked prs @github behind the scenes. the merge box is way more complex than you think, we touched code that hadn't been updated in a decade, and we set a swarm of agents loose trying to break it 🤯
full episode: https://t.co/glPgsX8CLH
@stratocastee 💯 as someone who personally is allergic to merge commits and always uses rebase, this has been one of my biggest gripes. It’s been my personal mission since I joined gh to make rebasing a better experience. More to come here!
Approvals are now retained for Stacked PRs after stack rebases ✅
Whether you use the "Rebase stack" button or partially merge a stack, as long as the diff doesn't change, PR approvals will be kept even if you have "dismiss stale approvals" turned on
We simulate merging the previously approved head with the new stack merge-base, then compare that result's git tree with the rebased head's tree. If they match and the review's recorded merge-base is still valid, we promote the approval to new head commit
To solve this, we now record the merge-base SHA of the entire stack alongside each review. This is the common ancestor of the reviewed head and the stack's base branch, giving us a reference point for checking the whole stack up to that PR
The challenge was telling the difference between replaying the same reviewed changes on a new base vs. actual changes that have been introduced that need another review. In a stack, that means accounting for the PRs below, too
PR approvals are tied to commit IDs and since a rebase/force-push rewrites those, it would previously always result in reviews being dismissed. We do have a system for "promoting" approvals but historically it only worked with merge commits
@flybayer@jacobmparis If you hit merge on the nth PR, it will generate all n merge commits, make one push to main, and mark all the PRs as merged. It doesn't happen one at a time
@flybayer We recently updated how stacks work in merge queue to ensure PRs always land in the same merge group. We're working on another update so CI only runs for the head PR in merge queue instead of each individual PR
@flybayer Stack merges are atomic. When you merge multiple PRs in a stack, it creates all the merge commits and makes one push to main. Your CI should then run off the head commit
@smanojshere@github If you have a rule that allows bypass, you can use it to skip approvals. Doesn’t matter how many approvals are are needed
The limitation is you must bypass on one PR at a time (can’t bypass and merge multiple PRs in one click)
So much exciting work happening in git systems right now! Moving to blob-storage and decoupling compute while simultaneously unwinding mountains of tech debt and unnecessary dependencies. 35x higher write throughput ⚡️
Git activity more than doubled between September 2025 and August 2026, reaching 473.3B events per month.
We’re rebuilding our Git infrastructure while GitHub keeps running, creating a foundation for agent-scale software development. https://t.co/H5J2qxCqMT