> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cubic.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Merge your stack

> Merge a GitHub stack in one step, or other stacked PRs from the bottom up.

How a stack merges depends on whether it's a GitHub stack.

* **A GitHub stack** merges in one step. Open the highest PR you want to merge and merge it from the
  **Merge** menu. cubic merges it along with every PR below it that hasn't merged yet. The PRs above
  it stay open, and GitHub rebases them onto the stack's base branch.
* **Branches stacked with `mg`** are separate PRs until you
  [turn them into a GitHub stack](https://docs.github.com/en/pull-requests/how-tos/create-pull-requests/creating-stacked-pull-requests).
  Until then, merge them one at a time, starting with the one at the bottom.

After merging, update your local stack:

```bash theme={null}
mg sync
```

Merged branches disappear from `mg list` unless they still have unmerged children.

For merge queues and merge methods, see
[Check and merge](/code-review-platform/reviewing-prs#check-and-merge).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.