Service eligibility and regional restrictions
PuppyIP serves only compliant overseas businesses and their authorized personnel. Proxy services are not available in mainland China. The service may only be used for lawful business activities outside mainland China. Use of this service within mainland China is prohibited.
Hosting a proxy IP or server overseas does not change these restrictions. The service must not be provided to end users in mainland China through relaying, forwarding, sharing or resale. Before use, read the Terms of Service.
Key Takeaways
- Merge a stack from its lowest unmerged layer upward; selecting a middle pull request also merges every unmerged pull request below it.
- Chain branches in dependency order so each pull request presents a focused change relative to the layer below. All branches in a stack must be in the same repository.
- The bottom pull request’s base branch sets the merge requirements. Lower pull requests need approvals and passing checks, the stack needs linear history, and the selected pull request must satisfy the base branch’s rules.
- Rebase stack creates signed replacement commits and retains approval only when a pull request’s diff is unchanged, even if the repository dismisses stale approvals.
Merge from the lowest unmerged pull request upward
Merge a GitHub stack from its lowest unmerged layer upward. GitHub lets you merge one pull request or a contiguous group, but every selected group must start at the lowest unmerged layer. Selecting a middle pull request therefore includes all unmerged pull requests below it; pull requests above it stay open and automatically retarget to the stack base. Selecting the top pull request merges the entire stack. Check the stack map before merging so you know which layers will land together.
For a hypothetical three-layer stack, PR #1 adds shared types to main, PR #2 adds API endpoints on top of the types branch, and PR #3 adds a UI on top of the API branch. If only #1 and #2 are ready, selecting #2 merges both in bottom-up order; #3 stays open and targets main afterward. This example illustrates the rule and does not prescribe branch names.
Organize branches and review layers by dependency
Build the chain so each branch contains the work it depends on. The bottom pull request targets the stack trunk, usually the default branch such as main, but it can also target a release branch. Each later pull request targets the branch of the pull request immediately below it. Put foundational changes such as shared types or database schema lower in the stack, then place dependent API and interface work above them. Keep each layer focused so reviewers can assess its change in context. A layer’s prerequisites must already exist in that branch or a lower one; it should not depend on work found only in a higher pull request.
Branches in a stack must be in the same repository. Cross-fork stacks are not supported, and GitHub Desktop does not support stacked pull requests. The stack map in GitHub’s web interface shows each layer and its status, helping teams review changes in dependency order, including contributions submitted for review after an AI agent generated them.
Check merge requirements across the whole stack
Mergeability is determined for the stack, not just the pull request currently open. The base branch of the bottom pull request determines the merge requirements for every layer. Before a layer can merge, all pull requests below it must be approved and have passing checks; the stack must have linear history; and the selected pull request must meet the branch protection rules for the stack base. Rules such as CODEOWNERS approval apply to every pull request in the stack, including middle layers. CI checks triggered by pull requests against the default branch also run for every pull request in the stack.
Review each layer’s diff relative to the branch below it, then check the stack status. Approval or a passing status on the top pull request does not bypass an unmet requirement below. If a required check, approval or base-branch rule is missing, resolve it through the repository’s existing review and CI process before merging.
Run Rebase stack when branches change
Changes below the current pull request can make a stack’s history non-linear. For example, someone may push new commits to a lower branch, or the trunk may advance while the stack is open. When GitHub shows a Rebase stack button in the merge box, it indicates that the stack needs rebasing first. The operation updates dependent branches so their history follows the base before the stack can merge.
GitHub creates signed replacement commits when rebasing a stack. It retains approval for a pull request when its diff has not changed, even if the repository dismisses stale approvals. Retention depends on an unchanged diff; if the change itself is different, review it again through the team’s normal process. After a partial merge, the next unmerged pull request is automatically rebased to target the stack base directly, becoming the lowest layer to review and merge next.
Check availability and merge-queue behavior
GitHub announced general availability for stacked pull requests on October 6, 2026, and said the feature is available on all github.com plans. The announcement said it would be included in an upcoming GitHub Enterprise Server release but did not identify a released GHES version; verify support on the instance you use. The documentation also describes support in GitHub’s website, GitHub CLI and GitHub Mobile, as well as programmatic integrations. The gh stack extension for GitHub CLI supports local stack workflows.
Stacks support merge queues, which add the whole stack in the correct order. If a pull request is removed or ejected from the queue, the pull requests above it are removed too. For merging stacks through the REST API, GitHub requires the asynchronous merge API for stacks. Do not guess an endpoint or assume the ordinary single-pull-request merge flow applies. The feature does not replace a repository’s approval, check or release requirements.
Sources
Frequently Asked Questions
Which merge methods can I use for stacked pull requests?
Stacked pull requests support merge commit, squash and rebase. The resulting history is the same as merging each pull request individually from the bottom up.
Can I add pull requests to a stack after the entire stack has merged?
No. Once every pull request has merged, the stack is complete and cannot be extended. If you submit new branches with GitHub CLI’s gh stack submit command, GitHub CLI starts a new stack rooted at the trunk.