Stacked pull requests are now in public preview 🚀 #201439
Replies: 447 comments 247 replies
|
gh extension install github/gh-stack |
|
My claude code workflow would love if the CLI allowed merging stacks as well. Further, when the stack requires a rebase, the "merge" button is still green and seems to attempt a merge that will inevitably fail, this is rather frustrating as it takes quite some time for the UI to reflect this |
|
Please show the PR approvals on the stack list and merge stack list! |
|
Idk if I did something wrong, but I did merge PR2 and then PR1 and only got PR1 merged to main. I had to merge main into PR2 and solve conflicts to be able to merge that one as well. In any case, I think it's not very intuitive what's going on; this was my structure:
|
|
Thanks for the 🥞! |
|
Can I unstack them so that I can merge things? Right now I have a PR to Branch A and cannot merge it because the PR from Branch A to Develop is blocking it, seems kind of dumb. |
|
A share button that copies the links to each PR in the stack so I can share with my colleagues when asking them to review |
|
It would be great if you made it so these new stack commands worked via github PATs - otherwise it will be a little dangerous with agents (you have to give them full access). |
|
this feature looks really promising, but I think it only becomes useful when a contributor who doesn't have access to the repo can stack PR submissions. unless I'm missing something, all branches must be in the same repo currently. They aren't when you submit a PR to another repo, and you might want to stack onto your first PR |
|
I have a use case for this that would be greatly improved with a pretty minor change. Occasionally, I need to make a change that should be deployed in multiple separate steps. For example, removing an S3 bucket from a Terraform deployment - first I need to merge a change to enable force-destroy and apply that (so it can be removed without emptying its contents first), then I need to merge a second change to actually remove it. Stacked PRs look like a great way to create both PRs ahead of time and mark them as related for reviewers, but I don't see any way for the stack creator to force the individual PRs to be merged separately. In the case I described above, someone merging both of them at once defeats the purpose and causes a failed apply. If I could disable merging multiple PRs at once for a specific stack, it would be much more useful and safer for this use case. |
|
I lowkey dislike the github stacks feature they added |
|
EDIT: Seems there is a phased rollout, as we now have support! This feature is not currently working for any repo in our organization that has a Merge Queue. Is there any guidance of how to enable this? I verified this to see 404 vs. 200 statuses for the stack feature against all of our repos. |
|
Would be nice to be able to mark a whole stack as "ready for review" at once |
|
All commits before the stack are suddenly unverified even though no changes were made to my local signing ability, any commits pushed up after stacking are verified as usual |
|
Stacks seem to lock branches in merge conflict state. Usually I have to change the base branch, then change it to the original base branch again to make Github realise there are no conflicts. Not sure if this is directly related to stacks, but I have to unstack the PR to be able to change the base branch so Github stops blocking merge because of a non existing merge conflict. |
|
For example, given
GitHub's stacked PR docs only describe a single linear chain per stack, so this doesn't look supported today. |
Feature request: set upstream tracking on
|
|
Bug Summary: Stacked PR merge box shows "Not ready" without explaining that an unresolved review thread is the actual blocker. Feature: Native stacked pull requests (public preview) What happened: Root cause (found via the API, not the UI): On a standalone (non-stacked) PR, this same situation normally surfaces a clear banner (e.g., "X unresolved conversation(s)") right above the merge button. That messaging doesn't appear to carry over to the stacked-PR merge box/stack-map widget. Impact: Suggestion: |
|
I am not sure if this was mentioned elsewhere before but I have this branch setup currently:
(in https://github.com/matrix-org/matrix-conf-website/ ) It seems I can only stack one lane but not each variant of the tree. Ideally I would want 3 stacks here. Possibly 4 depending on how to split it.
These are the actual feature branches. Depending on how the system can split it/deal with it it my make sense to have a dedicated stack for 260 + 261 here as well thats the basis of the other 3? Ending up with these stacks:
I am not entirely sure whats best in the end but at least the current solution where only one branch stack is possible for this scenario is a bit annoying and limiting. I for now for example only end up doing 260 + 261 and the other ones are not stacked. |
|
The CLI seems to mess up new lines in |
Bug Summary: Stacked PR merge is blocked even though all items within are "Ready" for merge.Feature: Native stacked pull requests (public preview)What happened:On our staging branch, we have enabled branch protections and enabled some rather strict rules - such as requiring Code Owner approvals, requiring third party reviews when an AI is involved, requiring our CI/CD workflows to succeed, etc... Regardless of these rules though, this bug will still occur when every branch in the PR stack is showing that squash and merge is a legal action and the stack is ready for merge. When using the front-end, we click the button to merge the stack, and all items in the stack will go into the "Merging" state with the purple banner. After a brief period typically being no longer than 20 seconds, the branch state will return to the green banner-ed "Ready" state, and the merge will not have occurred. Using the ❯ gh stack merge
✗ merge failed: Repository rule violations found
At least 1 approving review is required by reviewers with write access.Again, the front-end is showing all PRs as ready for merge, all of those who have approved the stack PRs do have write access, so I am not understanding why this is occurring. Impact:This feature is unusable by our team until this is fixed. |
|
This might be a dumb question but why doesn't |
I have a moderately high-traffic repo at work. The repo uses Merge Queue to ensure tests pass with the base branch merged in, and Pull Requests aren't required to be up-to-date with the base branch before merging. However, with stacked PRs, it seems it becomes a requirement that they're up-to-date with the base branch before merging. This makes it harder to merge stacked PRs, since by the time CI finishes running against the rebased branch tip, there's a good chance that someone else merged a PR and the stacked PRs become out-of-date again. Note: we use squash-merge. |
|
Stale review dismissal completely blocks the ability to merge a stack: github/gh-stack#323 @imanmahjoubi is this going to get looked at? |
|
The meaning of "sync" is not clear to me. Since it's not a term that is otherwise used by git or GitHub, it would be great to expand the help text a bit more than "Sync the current stack with the remote". Also how to I get the remote changes to a stack pulled down to a machine when I have worked on that stack before? |
|
Since early August, some commits that land via Rebase and merge have no associated PR: In one private repo (rebase merge only), all multi-commit rebase merges through July 24 are fully associated. From August 5 on, 15 commits are missing. Each is a non-last commit of a multi-commit PR, in both stacked and non-stacked PRs. The last commit is always associated. The timing matches the stacked PRs preview, so I suspect a related change in the merge path. |
|
I submitted a stack and I listed the branch names in git log order, and so gh stack just submitted the latest branch and barfed on all the rest. It seems it would be trivial for gh to support reordering the branches since they depend on each other, or literally just let me submit my base and feature branch and infer the intermediate ones. |
Stack merge fails "Waiting on code owner review" when the ruleset dismisses stale approvals, even with every PR approved at its headWhat happenedMerging a 7-PR stack with "Squash and merge stack", and with Setup
What we tried
ExpectedAn approval given at a PR's current head should count as a fresh code-owner review when the stack merges. Likely cause (our reading, not confirmed)Each PR in a stack is evaluated against the stack base. The approvals may be judged stale against that AlsoThe pre-merge check ("Able to merge as a stack", every PR "Ready") disagrees with the rule evaluation at WorkaroundTurn off dismiss stale approvals, merge the stack, then turn it back on. When2026-10-02, stacked pull requests public preview, gh-stack v0.1.1 |
|
One improvement I would really like to see is better control over how stacks are created and merged. The current linear stack model works well when every PR strictly depends on the layer below it, but real workflows can have multiple independent branches sharing the same base. In those cases, forcing everything into one linear stack can create unnecessary coupling. It would be useful to support: Choosing the base branch when creating a stack. Creating multiple stacks from the same parent branch. Treating PRs as dependencies without requiring them to be merged together. Setting a per-stack merge policy, such as sequential-only merging. Showing the exact rule, approval, or CI check preventing a stack from being merged. Allowing intermediate PRs to be merged independently without restructuring the entire stack. This would make stacked PRs much more predictable for teams with development, staging, and production branch workflows. The same principle applies to content teams managing many independent changes, such as updating a product page for Custom Frozen Pizza Boxes while other unrelated pages are being worked on. Not every change belongs in the same dependency chain. Overall, the feature is useful, but giving repository owners and stack creators more control over dependency and merge behavior would make it safer for more workflows. |






Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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.
072926-gitub-tmp-pr-v08.mp4
With stacked pull requests, teams can:
main.And because stacked pull requests are built into GitHub, your existing reviews, checks, and merge requirements all work out of the box.
Get started with the CLI extension
Install the CLI extension and create your first stack in under a minute:
Create stacks from your terminal or github.com
Create a stack from github.com, the GitHub CLI, the GitHub mobile app, or with a coding agent such as GitHub Copilot using the gh-stack skill. Start with a branch and pull request for your first change. Then add branches and pull requests on top of it; each pull request targets the layer below it.
Stacks-Changelog-InLine-01-CLI.mp4
Review each layer independently
Open any pull request in the stack to review only the diff for that specific layer. Use the stack map at the top of the pull request to see how the change you're reviewing fits into the larger work. You and your teammates can each review different layers in parallel without blocking further work.
Merge everything in a single click
Merge the latest ready pull request to land it and every unmerged layer below it in one single operation. To land part of a stack, merge one or more lower layers—the pull requests above it stay open and automatically rebase and retarget. Your existing branch protections and required checks still govern what reaches
main.Stacks-Changelog-InLine-03-MergeBox.mp4
Find out more and share your feedback
Stacked pull requests are rolling out in public preview to all repositories over the coming days. Merge queue support for stacked pull requests is rolling out progressively over the coming weeks.
For more information, check out the stacked pull requests documentation, and share your feedback with us in the comments below!
All reactions