doc/user/project/merge_requests/reviews/stacked_merge_requests.md
{{< details >}}
{{< /details >}}
{{< history >}}
{{< /history >}}
When you split a large change into smaller merge requests that build on each other, GitLab groups them into a stack. Each merge request in a stack targets the source branch of the merge request below it, so the changes form a chain from the default branch up to the most recent work.
Use stacks to:
GitLab detects a stack automatically. A merge request joins a stack when it targets another open merge request's source branch, or when another open merge request targets its source branch. A stack can contain up to 10 merge requests.
To create stacked merge requests from the command line, use stacked diffs in the GitLab CLI.
When a merge request is part of a stack, the merge request header shows a stack control next to the source branch. The dropdown list displays the position of the current merge request in the stack, for example 1 of 2.
To move between merge requests in a stack:
The list shows every merge request in the stack, ordered from the top of the stack down to the bottom. For each merge request, the list shows the title, when it was opened, and the number of changed files, additions, and deletions. An arrow marks the merge request you're viewing.
GitLab is designed for you to merge a stack from the bottom up. The merge request at the bottom of the stack targets the default branch and merges first, even though it's the only merge request that targets the default branch directly. The merge requests above it merge in sequence afterward.
To merge a stack from the bottom up:
For more information about how GitLab updates the target branch, see update merge requests when target branch merges.