Hacker News ★ 78 2 min

Stacked PRs are now live on GitHub

🔗 https://github.blog/changelog/2026-07-30-stacked-pull-requests-are-now-in-public-preview/

📌 【GitHub 新功能】Stacked PRs 正式推出:將大型變更拆解為可複審的層級結構

TL;DR:GitHub 推出 Stacked PRs 公開預覽版,讓開發者能將大型變更拆分為多個小型 PR,提升審核效率。

面對日益龐大的程式碼變更,開發者常面臨「單一 PR 過大導致審核困難」或「手動拆分分支與 rebase 成本過高」的兩難。GitHub 現在推出了 Stacked pull requests 功能,旨在解決這項開發痛點。

🧩 將大型變更拆解為有序的層級結構

Stacked pull requests 提供了一種有序的 PR 序列,每個 PR 代表變更中一個特定的層級(layers):

  • 獨立審核:你可以針對每個小型 PR 進行獨立的審核與檢查。
  • 一鍵合併:完成審核後,可以選擇一次性合併整個堆疊(stack),或是逐一合併個別的層級。
  • 無縫整合:由於功能內建於 GitHub,現有的審核機制(reviews)、檢查(checks)與合併需求(merge requirements)皆可直接使用。

🚀 實戰案例:Next.js 與 jQuery 的開發體驗

  • Next.js (Vercel):Next.js 團隊在過去幾個月已使用此功能,幫助他們在開發大型功能時,能同時導入更小的獨立變更,讓 PR 審核變得更容易。
  • jQuery:jQuery 創作者 John Resig 表示,這個功能大幅減少了摩擦,例如可以直接將 5 個 stacked PR 一次送入合併隊列(merge queue)。

🎯 實務啟示

對於需要頻繁處理大型功能開發的團隊,Stacked PRs 能讓開發流程更流暢:團隊可以並行審核範圍狹窄的 PR,在維持代碼品質的同時,確保大型功能開發的進度不會因為單一 PR 審核過慢而停滯。

🔗 來源

#GitHub #SoftwareEngineering #Productivity #DevOps #PullRequest #OpenSource #SoftwareDevelopment #Vercel #jQuery #Workflow

原始資料 Hacker News · 收集於 2026-07-31
來源原標題
Stacked PRs are now live on GitHub
作者
tomzorz
原始標籤
hackernews
來源訊號
HN points 621 HN 留言 207
原始連結
https://github.blog/changelog/2026-07-30-stacked-pull-requests-are-now-in-public-preview/

摘要原文

Back to changelog Stacked pull requests break large changes into small, reviewable pull requests. They’re an ordered series of pull requests that each represent focused layers of your change. With stacks, you can independently review and check each pull request, then merge everything together in one click. No more opening a single large pull request that takes forever to review, or splitting work across multiple branches you have to keep manually rebasing. “We’ve been using GitHub stacked PRs for Next.js for the past few months. It has helped us introduce smaller individual changes while shipping larger features, making it easier to review PRs. – Tim Neutkens, NextJS lead, Vercel” With stacked pull requests, teams can: Keep large changes moving by reviewing short, narrowly scoped pull requests in parallel. Maintain quality across every layer by using focused pull request reviews alongside existing branch protections to protect main . Merge one, some, or all by landing an entire stack altogether or individual layers one at a time. And because stacked pull requests are built into GitHub, your existing reviews, checks, and merge requirements all work out of the box. “The new Github Stacked PRs preview is incredible. Landing 5 stacked PRs directly to a merge queue all at once! A+++! This removes so much friction (and the gh cli tools + agent skill help a ton)” – John Resig, creator, jQuery Get started with the CLI extension Install the CLI extension and create your first stack in (621 points, 207 comments on Hacker News)

tencent/hy3:free 自動生成