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

> Shortcut to create and switch to a new branch

## Name

`mg branch` — Create a new branch on top of the current one and immediately check it out.

## Synopsis

```bash theme={null}
mg branch <branch_name>
```

## Description

* Creates a new branch on top of the branch you are currently on

* Automatically moves you to the newly created branch.

## Options / Flags

* **`-t, --from-trunk <branch_name>`**: Checkout the default/main branch and create a new branch on top.

* **`-D, <branch_name>`**: Force delete branch (in mg and in git)

## Examples

```bash theme={null}
mg branch feature/payments
```

<Note>
  You can always see what your tree structure looks like with [mg list ](/reference/mg-checkout). -
  See also [mg checkout](/reference/mg-checkout) for switching branches.
</Note>
