Preview each PR (the default)
Each pull request in the stack gets its own preview of its own change:- The bottom pull request is compared with the default branch, as usual.
- Each pull request above it is compared with the pull request below it. Its “before” is the “after” of the preview below, so a flow the pull request below already worked out isn’t worked out again.
- Previews run bottom up. A pull request’s preview waits for the one below it to finish.
main, so this includes #41 and #42.”
When you push to a lower pull request and rebase the ones above, each is previewed again. Flows the lower change doesn’t touch are carried forward with no credits, so a rebase costs only what the change touches.
Preview the top only
An owner or admin can switch the workspace to one preview per stack in Settings › PR previews, under Stacked PRs:- Preview each PR. Every PR in a stack shows its own changes, compared with the PR below it.
- Preview the top only. One preview of the whole stack, compared with the default branch. It uses fewer credits when several pull requests in a stack change the same flows.
Which setting to choose
If your stacks usually change the same shared code at each level, Preview the top only costs less. If they touch separate areas, both cost the same and Preview each PR gives each reviewer their own view.
Other settings still apply to each pull request in a stack: previews on request, Review every push, and drafts.
Merging a stack
- A merged stack shows as its pull requests. On Changes and in each flow’s history, the merge is credited to the pull requests it came from, not shown as a direct push.
- The merge reuses the stack’s previews. When the merged code matches a previewed state of the stack, the merge takes the previewed flows with no further credits.
- Merging part of a stack is fine. After the bottom pull request merges, GitHub points the next one at the default branch, and it becomes an ordinary pull request. Because its base changed, it’s previewed again against the default branch: on its own if previews are automatic, or when someone asks if they’re on request.
Next steps
PR previews
What a preview shows and how to request one.
Merges
How flows update when a pull request merges.