> ## Documentation Index
> Fetch the complete documentation index at: https://forest-chore-open-api.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# forest branch

> Create a new branch or list and delete your existing branches

# forest branch

Create, list, or delete layout branches. Branches work similarly to Git branches, but for your Forest UI layout, they let you isolate UI changes while you develop a feature, then push or deploy those changes when ready.

## Usage

```bash theme={null}
forest branch [BRANCH_NAME] [options]
```

## Arguments

| Argument      | Description                                                    |
| ------------- | -------------------------------------------------------------- |
| `BRANCH_NAME` | Name of the branch to create (optional, omit to list branches) |

## Options

| Option            | Description                                   |
| ----------------- | --------------------------------------------- |
| `-d, --delete`    | Delete a branch                               |
| `--force`         | Skip confirmation when deleting a branch      |
| `-o, --origin`    | Set the origin environment for the new branch |
| `-p, --projectId` | The ID of the project to work on              |
| `--format`        | Output format: `table` (default) or `json`    |
| `--help`          | Display usage information                     |

## Listing branches

Run `forest branch` without arguments to list all your existing branches:

```bash theme={null}
$ forest branch
NAME                    ORIGIN      IS CURRENT  CLOSED AT
feature/new-button      production  ✅
fix-missing-label       staging
feature/remove-tooltip  preprod                 2022-08-19T08:08:47.678Z
```

The **IS CURRENT** column shows your active branch, the one your Development Environment is currently using.

## Creating a branch

Append a branch name to create a new branch:

```bash theme={null}
$ forest branch feature/new-ops-feature --origin production
✅ Switched to new branch: feature/new-ops-feature
```

<Info>
  Your project must have at least one remote or production environment before you can create branches.
</Info>

```bash theme={null}
$ forest branch add-refund-action
❌ You cannot create a branch until this project has either a remote or a production environment.
```

### Branch origins

Every branch needs an **origin**, the environment whose layout state the branch starts from. Your layout changes build on top of the origin's layout.

* If you omit `--origin`, the CLI prompts you to select one interactively.
* Branches usually originate from your Production or a Remote Environment.

<Tip>
  There are no specific constraints on branch names, but **kebab-case** is the convention. Branch names must be unique within a project.
</Tip>

## Deleting a branch

Use the `-d` flag with a branch name to delete it:

```bash theme={null}
$ forest branch -d hotfix/fix-dropdown-issue
? Delete branch "hotfix/fix-dropdown-issue"? Y
✅ Branch hotfix/fix-dropdown-issue successfully deleted.
```

You will be prompted to confirm deletion. To skip the confirmation:

```bash theme={null}
forest branch -d hotfix/fix-dropdown-issue --force
```

## Examples

```bash theme={null}
# List all branches
forest branch

# Create a new branch with a specific origin
forest branch feature/customer-export --origin production

# Create a branch in a specific project
forest branch feature/new-view --projectId 42

# Delete a branch
forest branch -d feature/old-experiment

# Delete a branch without confirmation
forest branch -d feature/old-experiment --force

# Output branch list as JSON
forest branch --format json
```
