The GitHub Podcast

Stacked PRs, Ghost Merges, and the Merge Box: Inside GitHub's Biggest Pull Request Change in Years

Episode Notes

Cassidy and Andrea are joined by Sameen Karim, Senior Product Manager at GitHub, to dig into stacked pull requests, GitHub's newly launched (and long-requested) way to break large changes into a linked chain of small, reviewable PRs. Sameen pulls back the curtain on just how deep this went: every time a PR updates, GitHub runs a live "ghost merge" simulation behind the scenes to check whether it's mergeable, and stacking meant multiplying that complexity across up to 100 linked PRs at once. The team had to rethink core assumptions about how a PR's base branch relates to its actual merge target, rewrite parts of the merge box that hadn't been touched in over a decade, build an entirely new asynchronous merge path, and close a code owners loophole that could otherwise let people sneak changes past review. Sameen also talks about "agent-driven testing," where GitHub ran swarms of agents around the clock trying to break the feature, how teams like Vercel, Nuxt, and the React team are already adopting stacks, and what's next: support for stacks across forks. The episode closes with three open source picks: Sarah Drasner's visual code explainers, the AGENTS.md standard, and the open source gh-stack CLI Sameen built (and rewrote in Go) to manage stacks locally.

Links mentioned in the episode: