Stacked pull requests generally available

GitHub stacked pull requests are now generally available. Break large changes into smaller, focused pull requests that you can review independently and merge together.

Since the feature went into public preview, repositories using stacks have seen a 9% increase in merged code compared to peers. Over two-thirds of the top 1% of repos now use stacked pull requests and have seen a 5% improvement in time-to-merge.

With this general availability release, we’re introducing several improvements to make stacks easier to create, review, and merge. Thank you to everyone who provided feedback and input during the preview period.

  • Approvals stay in place for unchanged code. When an otherwise unchanged stack is updated after its base branch, such as main, moves ahead, Rebase stack now preserves approvals, even in repositories that dismiss stale approvals.
  • Rebased commits stay signed. GitHub creates signed replacement commits during Rebase stack, preserving original authorship. Automatic rebases after partial merges also sign replacement commits when branch rules require signatures or any original commit was signed.
  • Bypass permissions apply to stacks. Users with permission to bypass repository rules can now use those permissions to merge the lowest unmerged pull request in a stack.
  • More consistent stack merging. A stack now enters and lands through the merge queue as a single merge group. When using the merge commit method, GitHub now creates one merge commit per pull request instead of one for the entire merged group.
  • Branching stacks retarget automatically. When a stack’s base branch is deleted, GitHub automatically retargets the stack instead of closing its bottom pull request. This supports workflows where one stack branches off another.
  • Auto-merge for stacks rolling out over the next few weeks. Stacked pull requests can be set to merge automatically once the repository’s merge requirements are met. Select a group of pull requests and they will all merge together once all the pull requests are ready to merge.
  • Stack context stays visible. Stack information is now always visible in the pull request page’s persistent header. View details about the stack that a pull request belongs to from the pull requests list view.
  • Keyboard shortcuts. Use Shift+J and Shift+K shortcuts to navigate between pull requests in a stack.
  • Stack membership lifecycle. View events in the timeline for when a pull request was added or removed from a stack. The pull_request webhook now includes a stacked action when a pull request joins a stack.
  • CLI and agent workflows support more ways to work. The gh stack extension for GitHub CLI now supports Git worktrees and includes several improvements to speed up initialization, checkout, and navigation.

Stacked pull requests are available on all github.com plans and will be included in an upcoming GitHub Enterprise Server release.

Check out the stacked pull requests documentation to learn more about the feature and how to get started.

添加评论
点赞收藏
点踩分享查看原文
评论
?
参与讨论