Stacked pull requests are now in public preview 🚀 #201439
Replies: 411 comments 237 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 |
|
I ran into an issue using stacks + merge queues + Merge queue partial-merge closes the next stack layer: automatic base change stops one hop short of mainSummary. When a stack is merged through a merge queue and the queue merges only a lower prefix of the stack, the first unmerged layer gets closed. GitHub's automatic base change moves it one hop to the merged PR's declared base, but that base is a sibling stack branch deleted in the same sweep, and a PR whose base branch is deleted is closed. Seen twice in two weeks on our repo ( Repro (from the timeline of our PR #1095, 2026-09-05, all times UTC).
The earlier occurrence (2026-09-02) was the same shape but the dequeue reason was Expected. Either the automatic base change should cascade through merged-and-deleted stack branches until it reaches a branch that still exists ( Recovery is awkward. Also worth noting: My current workaround is to disable "automatically delete head branches" but would love a fix here |
|
Previously I faced this bug: https://github.com/orgs/community/discussions/201439#discussioncomment-18048036 Now, it seems like they changed the behaviour to not automatically rebase PRs up on the stack if the one below it was merged. In fact, it seems like there's no way to manually switch the base branch of the PRs above the stack. So after merging only PR A to dev, PR B is stuck targeting PR A. The only workaround is to unstack the entire thing, then switch base branch of PR B to dev. Surely this has to be the wrong behaviour? At that point, why even allow merging intermediate PRs on the stack if all the PRs above get stuck in limbo. (I suppose my bug above is solved in the sense that it massively delays the ability to switch the base branch of PR B and merging. But this defeats the whole point of stacked PRs for me.) To reiterate
|
ContextWe use Problem
Expected behaviorAfter merging a branch that re-triggers required checks on the following branches in the stack, This mirrors what we'd get by manually waiting between each merge — Additional contextThe check in question is an Azure DevOps pipeline triggered through the GitHub Checks integration (not GitHub Actions), so its turnaround time is outside |
|
Few Feature gaps: Scenario: ISSUES:
|
|
It will be nice to have an ability to stack PRs from different repos, in at least one org. |
|
We hit a bug in the stacks preview: a PR sitting in the merge queue was closed instead of merged. A stack of four, A at the bottom, then B, C, D. Automatic deletion of head branches is on. A reviewer added C to the merge queue, which put A and B in with it. D, above C, stayed out. Timeline in seconds from the first merge: +0s A merged into main (base main, head branch a) The retarget moved C one hop up, onto A's branch, and that branch was deleted in the same second. The deletion of the new base then closed C. main would have worked, because A and B were merged there already. Reopening C closed it again within a second. D was fine a few hours later, when its parent merged straight into main. What would help us:
|
|
The docs say that a stack's trunk is "usually your repository's default branch, such as main, though it can be any branch, such as a release branch." (emphasis added), but that appears to not be configurable in the web interface. I had a case where I have a larger/long-running branch (hereafter Maybe this is possible via the CLI tool, but I don't have that set up and so I decided to unstack the PRs and handle things separately. If the trunk branch can actually be any branch, it would be nice if the web interface provided that ability to select/edit the trunk branch. |
|
I've found it really hard to add existing PR/branches to a stack, and to understand the internals, so I know what is possible here - I want to add a branch in between 2 others in the stack, how can I go about getting it in the right state for that? It would be good if you could what position the branch is added, then stacks automatically rebases it (and can tell you upfront that it's not possible because of the commits it contains cause conflicts, etc) |
|
I reordered PRs in a stack with I had to recreate the stack with just the new PRs and lost the merged PRs from the history |
|
With the Also |
|
There is another bug with partially merged stacks, this time around creating a new stack. Situation
Expected BehaviorI expected github to create my brand new stack remotely as Actual BehaviorThey cannot be removed from the stack because they have already been merged, but likewise I apparently cannot create a new stack with NotesNote 1: I recognize I could have attempted to Note 2: Note 3: When I'm stuck in this limbo new stack still connected to an old remote stack somehow, |
|
Bug or poorly defined behavior within SituationI have an existing local stack based off a feature branch I run Expected BehaviorI would expect that if this is based off of a feature branch already, and the PR 123 also already diffs off of Actual BehaviorInstead of detecting the existing base of the stack (which does exist locally prior to linking, and the bottom PR already points to the correct Then, the UI doesn't let me change the base branch back to Suggested fixIf you wish to assume that the user wishes to link to the default branch then there should at least be a prompt asking what base branch the user intended. |
|
Would be nice if you could essentially the reverse of running |
|
Totally something to help my AI-first team handle large PRs with the v2 of our product. |






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