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

> Interactive commit splitting or folding

## Name

`mg split` — Rewrite Git history by splitting or folding commits.

## Synopsis

```bash theme={null}
mg split <commit_sha> [--fold]
```

## Description

* Opens an interactive interface to let you choose how to break large commits into smaller ones.
* With `--fold`, merges multiple commits into one.

## Options / Flags

* **`--fold`**: Instead of splitting, fold consecutive commits into a single commit.

## Examples

```bash theme={null}
# Split a large commit
mg split abc123

# Fold commits interactively
mg split abc123 --fold
```

<Note>
  * Rewrites history; child branches may need to rebase if they depend on the modified commits. -
    Use caution with previously pushed commits, as force pushes might be required.
</Note>
