GitHub Makes Stacked Pull Requests Generally Available

Daily Code Guide GitHub News

GitHub has made stacked pull requests generally available on github.com. The feature is designed for large changes that are easier to review when divided into smaller, dependent pull requests rather than submitted as one large branch.

For developers and maintainers, the change provides a more structured way to keep related work in dependency order while allowing each pull request to be reviewed independently. GitHub says stacked pull requests are available on all github.com plans. Support for GitHub Enterprise Server is planned for an upcoming release, but no release date was supplied.

What stacked pull requests change

A stack is a chain of dependent pull requests. Each pull request contains part of a broader change, and the relationship between the requests preserves the order in which those changes depend on one another. This can make a large implementation easier to inspect than a single pull request containing every change at once.

The individual pull requests can be reviewed separately, while the stack can ultimately be merged as a related unit. The approach is particularly relevant when a change naturally breaks into layers or when teams want reviewers to focus on smaller, more focused diffs without losing the context of the overall implementation.

GitHub’s release adds support across several parts of the pull request workflow, including rebasing, approvals, merging, branch-stack management, navigation, lifecycle events, and GitHub CLI support.

Ad

Rebasing and approvals

The Rebase stack operation is intended to update an otherwise unchanged stack after its base branch advances. GitHub says this operation preserves approvals, including in repositories configured to dismiss stale approvals.

Rebasing can create replacement commits. GitHub creates signed replacement commits during Rebase stack while preserving the original authorship. Automatic rebases after partial merges also sign replacement commits when branch rules require signed commits or when the original commit was signed.

Teams should still review their repository rules before adopting the workflow. In repositories with signed-commit requirements or stale-approval dismissal, the signing and approval behavior can affect how maintainers plan stack updates and reviews.

Merge queues and stack order

A stack enters and lands through the merge queue as a single merge group. This means teams need to reason about the stack as a related unit when considering queue processing, CI checks, and merge order.

When the merge commit method is used, GitHub creates one merge commit for each pull request rather than creating one merge commit for the entire merged group. That distinction matters for repositories where the resulting commit history is part of the maintenance or review workflow.

Users who are permitted to bypass repository rules can use those permissions to merge the lowest unmerged pull request in a stack. Because the pull requests are dependent, maintainers should account for stack order rather than treating every request as an unrelated candidate for merging.

GitHub also automatically retargets a stack when its base branch is deleted instead of closing the bottom pull request. This supports workflows in which one stack branches from another, although teams should still review the resulting targets and dependencies after significant branch changes.

Auto-merge is rolling out separately

Auto-merge for stacked pull requests was announced as rolling out over the following weeks. It should not be treated as necessarily available to every user at the time of the general-availability announcement.

Where the capability is available, selected pull requests can merge together after all pull requests in the selected group are ready and the repository’s merge requirements have been met. Those requirements remain important: teams cannot rely on stacked auto-merge without satisfying the applicable repository rules and checks.

More visible stack context

Stack information is persistently visible in the pull request page header, and stack details can also be viewed from the pull request list view. GitHub adds keyboard navigation with Shift+J and Shift+K for moving between pull requests in a stack.

The pull request timeline records when a request is added to or removed from a stack. The pull_request webhook also includes a stacked action when a pull request joins a stack. These events can help teams and tooling track changes to stack membership, although the supplied announcement does not document a complete webhook schema or automation example.

CLI support with the gh stack extension

GitHub’s documentation identifies the gh stack extension for GitHub CLI as a supported way to create and work with stacked pull requests. The extension supports Git worktrees and includes improvements for initialization, checkout, and navigation.

The official documentation covers a quickstart, CLI command reference, stack creation and management, merging, CI optimization, and review guidance. Exact installation commands, command syntax, flags, supported CLI versions, and operating-system requirements were not provided in the supplied release material, so teams should use the linked documentation for current setup instructions rather than relying on undocumented examples.

Who should consider using stacks?

Stacked pull requests may be useful for teams working on changes that are large enough to overwhelm a single review but have clear dependencies between their parts. Splitting the work can give reviewers smaller units to understand while retaining a defined sequence for integration.

The workflow also changes how maintainers think about branch targets, approvals, rebases, merge queues, and partial merges. It is therefore best evaluated as a team process rather than only as a different way to open a pull request.

GitHub reported that repositories using stacks saw a 9% increase in merged code compared with peers during the public-preview period. It also reported that more than two-thirds of the top 1% of repositories use stacked pull requests and saw a 5% improvement in time-to-merge. These are GitHub’s observations, not a guarantee that every repository will see the same results or evidence that stacks caused the improvements.

What you should do

  1. Identify a suitable change. Start with work that can be divided into dependent, reviewable units rather than converting every feature branch into a stack.
  2. Review repository rules. Check merge requirements, approval behavior, branch protection, and signed-commit rules before relying on rebasing or automated merging.
  3. Plan for bottom-up merging. Make the dependency order clear to reviewers and maintainers, especially when using bypass permissions or handling partial merges.
  4. Check auto-merge availability. The stacked auto-merge rollout was described as occurring over the following weeks, so confirm that the capability is available before building it into a workflow.
  5. Use the official documentation. Follow GitHub’s stacked pull request documentation and the gh stack command reference for setup and operational details.

General availability makes stacked pull requests a supported option for teams that need smaller reviews without abandoning dependency order. The main operational considerations are stack sequencing, repository merge requirements, approval preservation, and the separate rollout status of stacked auto-merge.

Sources

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top
Ad
Ad
Ad