> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vibehub.co.in/llms.txt
> Use this file to discover all available pages before exploring further.

# vibe branch

> List, create, or delete branches

## Usage

```bash theme={null}
vibe branch [name] [options]
```

## Description

Manage branches in your VibeHub project. List existing branches, create new ones, rename, or delete branches.

## Arguments

<ParamField query="name" type="string">
  Branch name to create. If omitted, lists all branches.
</ParamField>

## Options

<ParamField query="-a, --all" type="boolean">
  List all branches (local + remote).
</ParamField>

<ParamField query="-v, --verbose" type="boolean">
  Show branches with last commit info.
</ParamField>

<ParamField query="-vv, --very-verbose" type="boolean">
  Show tracking info and last fetch time.
</ParamField>

<ParamField query="-d, --delete" type="string">
  Delete a branch (safe - checks if merged first).
</ParamField>

<ParamField query="-D, --force-delete" type="string">
  Force delete a branch without merge check.
</ParamField>

<ParamField query="-m, --move" type="string">
  Rename a branch. Usage: `-m <old-name> <new-name>`
</ParamField>

<ParamField query="--set-upstream-to" type="string">
  Set upstream tracking branch for the current branch.
</ParamField>

## Examples

### List All Branches

```bash theme={null}
vibe branch
```

Output:

```
* main (default)
  feature/user-auth
  develop
```

The `*` indicates the current branch.

### List Branches with Details

```bash theme={null}
vibe branch -v
```

Output:

```
* main (default) abc1234
  feature/user-auth def5678
  develop (no commits)
```

### Create a New Branch

```bash theme={null}
vibe branch feature/new-feature
```

Creates a new branch from the current branch.

### Delete a Branch (Safe)

```bash theme={null}
vibe branch -d feature/completed
```

This checks if the branch is fully merged before deleting.

<Warning>
  Safe delete will fail if the branch has unmerged commits. Use `-D` to force delete.
</Warning>

### Force Delete a Branch

```bash theme={null}
vibe branch -D feature/abandoned
```

Deletes the branch regardless of merge status.

### Rename a Branch

```bash theme={null}
vibe branch -m old-name new-name
```

### Set Upstream Tracking

```bash theme={null}
vibe branch --set-upstream-to origin/main
```

## Branch Indicators

| Indicator     | Meaning          |
| ------------- | ---------------- |
| `*`           | Current branch   |
| `(default)`   | Default branch   |
| `[protected]` | Protected branch |

## Restrictions

You cannot delete:

* The default branch
* Protected branches
* The currently checked out branch

## Error Messages

### Branch Already Exists

```
A branch named 'feature' already exists
```

**Solution:** Choose a different name or checkout the existing branch.

### Cannot Delete Current Branch

```
Cannot delete branch 'main' checked out at current location
```

**Solution:** Switch to another branch first with `vibe checkout`.

### Branch Not Fully Merged

```
Branch 'feature' is not fully merged
  3 commit(s) ahead of 'main'
Use -D to force delete
```

**Solution:** Either merge the branch first or use `-D` to force delete.

## Related Commands

* [vibe checkout](/cli/commands/checkout) - Switch branches
* [vibe merge](/cli/commands/merge) - Merge branches
* [vibe fetch](/cli/commands/fetch) - Fetch remote branches
