> ## 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.

# mg sync

> Sync your stack with the remote trunk

## Name

`mg sync` — Pulls the latest remote trunk (e.g., `main`), then rebases against the latest commits, and prompts you to delete and push rebased chagnes to remote.

## Synopsis

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

## Description

* Fetches remote trunk, applies them to your current branch and all its children.
* By default, uses a rebase strategy to keep your commit history linear.

## Options / Flags

* : Use a merge strategy instead of rebase.

## Examples

```bash theme={null}
# Pull main, rebase your current stack on it.
mg sync
```

<Note>
  * Conflict resolution is interactive; you must resolve conflicts before the sync proceeds. - If
    your trunk has changed drastically, consider syncing more frequently.
</Note>
