跳到正文
GitHub Changelog· Allison·· 15 小时前AI 评分53

GitHub 堆叠 pull requests 正式可用

Stacked pull requests generally available

AI 导读

GitHub 宣布堆叠 pull requests 正式可用,可将大型改动拆成多个可独立评审、一起合并的 pull request。官方称预览期间使用堆叠的仓库合并代码量比同类仓库高 9%,前 1% 仓库中超过三分之二已在使用,合并耗时改善 5%。

正文

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.

More flexible merging and rebasing

  • 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.

“It took one merge with GitHub’s Stacked PRs for me to conclude that it’s amazing.”
Charlie Marsh, Founder of Astral, OpenAI

Stack navigation and automation

  • 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.

“Seeing every branch in the stack right in the GitHub PR UI, checking each one’s status, and navigating between them makes managing and reviewing many dependent PRs far easier. For a team reviewing each other’s work, that’s been a meaningful improvement in how we collaborate.”
David Mostoller, software engineer, Comcast

Get started

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.

The post Stacked pull requests generally available appeared first on The GitHub Blog.

来源:GitHub Changelog · github.blog