/trunk merge and Trunk processes them sequentially, testing and merging each one against the actual state of your merge queue branch.
What is a stack
A stack is a chain of pull requests connected through their base branches. Each PR targets the branch of the PR below it, and the bottom PR targets your merge queue branch:Step 1: Enqueue every PR in the stack
Each PR in the stack must be enqueued separately. Use any of the standard submission methods on every PR:- Comment
/trunk mergeon each PR. - Check the box in the Trunk comment on each PR.
- Use the CLI:
trunk merge <pr-number>for each PR.
Step 2: Automatic sequential processing
Once enqueued, Trunk handles the rest:- The bottom PR in the stack (base branch = your merge queue branch) enters the queue, runs tests, and merges.
- When it merges, GitHub automatically updates the next PR’s base branch from the previous feature branch to your merge queue branch.
- The next PR now targets the merge queue branch, so it proceeds through the queue.
- This continues until every PR in the stack is merged.
main:
- PR #1 (base:
main) → tests → merges - PR #2’s base automatically changes to
main→ tests → merges - PR #3’s base automatically changes to
main→ tests → merges - …and so on.