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

> Commit changes, optionally auto-generate a new branch

## Name

`mg commit` — Create a Git commit, with optional branch auto-generation.

## Synopsis

```bash theme={null}
mg commit -m <message> [--branch-name <name> | -b]
```

## Description

* A pass-through to `git commit -m <message>` but integrates cubic-specific features for branch naming.

* If you specify `-b` without a name, cubic will automatically generate a branch name based on your commit message or config rules.

## Options / Flags

* **`-m <message>`**: Commit message.

* **`-b, --branch-name <name>`**: Automatically create and/or switch to a new branch named `<name>` as part of the commit.

## Examples

```bash theme={null}
# Normal commit
mg commit -m "Fix login bug"

# Auto-generate a new branch from commit
mg commit -m "Add UI tests" -b
```

<Note>
  * This feature is optional; standard Git usage is still valid. - If using `-b`, ensure your
    `.cubicconfig` sets rules for auto-generated names (if desired).
</Note>
