GitHub 原生支持 PR 堆叠
推荐指数 59.0 NO. 015 · 2026.07.31
发布2026/07/30Score146Comments54
为什么值得看
GitHub 上线 stacked PRs 公测,将大改动拆分为可独立审查、一键合并的有序小 PR。AI 团队再也不用为拆分 feature 手动 rebase 多个分支,代码审查效率直接翻倍。
编辑判断
Stacked PRs 之前是 Graphite、Sapling(Meta 内部工具开源)这类第三方工具的核心卖点,GitHub 现在直接内置意味着这个工作流从小众最佳实践变成主流标准。Vercel/Next.js 团队提前几个月内测并站台,说明大厂已经在用这玩意儿加速大型 feature 的迭代。
如果你团队还在用「一个 PR 改 3000 行」或者手动维护 feature 分支链,建议直接申请公测。第三方工具可能面临用户流失,但 Graphite 的 CLI 体验和 CI 集成目前仍比 GitHub 原生更顺滑,短期内不用急着迁移。
社区反馈
正面 55 条评论
核心争论:原生堆叠PR是AI生成大代码的解药,还是早已有之的工程最佳实践?
相关内容
GitHub原生支援堆疊式PR工作流程,提供gh stack CLI與PR堆疊檢視 GitHub推出原生堆疊式PR支援與gh stack CLI擴充工具,讓大型程式碼變更可拆成多層相依PR逐層審查,並整合Stack Map、合併佇列與自動Rebase機制。 GitHub Stacked PRs 官方頁面 GitHub原生堆疊PR功能,目前處於私人預覽階段,提供gh stack CLI將大型變更拆分為小型、可審查的相依PR。 jabr - Stacked pull requests on plain git + GitHub CLI 基於純Git與GitHub CLI的堆疊PR工具,Claude原生技能,可將功能拆分為乾淨的相依PR鏈。
Really excited to try this. After using Graphite it's been very hard going back to stack-less GitHub. Hopefully this can make the stacked PR workflow more common and give people an easier alternative to mammoth PRs.
I'd recommend git-spice, it's very easy to use and powerful, and of course open-source. I've tried graphite but found that they made it too convoluted for what it is.
I will second git-spice. It does exactly what you want and, importantly, no more than that. There's no upsell to anything else; it's "just" a good tool that knows its purpose and boundaries.