---
title: tb branch
meta:
    description: Manage branches in your Tinybird project
---

# tb branch

Manages branches in your Tinybird project. Branches allow you to develop and test your project in ephemeral environments using production data. Global options apply to this command. See [Global options](/forward/dev-reference/commands/global-options).

The following subcommands are available:

{% table %}
  * Subcommand
  * Description
  ---
  * create BRANCH_NAME [OPTIONS]
  * Creates a new branch from your production workspace.
  ---
  * rm BRANCH_NAME [OPTIONS]
  * Removes an existing branch.
  ---
  * ls [OPTIONS]
  * Lists all available branches.
{% /table %}

## tb branch create

Creates a new branch from your production workspace. You can optionally include the last partition of production data.

```shell
tb branch create my_feature_branch
```

To create a branch with production data:

```shell
tb branch create my_feature_branch --last-partition
```

{% table %}
  * Option
  * Description
  ---
  * --last-partition
  * Brings the last partition of production data into the branch
{% /table %}

{% callout type="tip" %}
Use the `--last-partition` flag when you want to test your changes with real production data.
{% /callout %}

## tb branch rm

Removes an existing branch from your workspace.

```shell
tb branch rm my_feature_branch
```

To skip the confirmation prompt:

```shell
tb branch rm my_feature_branch --yes
```

{% table %}
  * Option
  * Description
  ---
  * --yes
  * Skips confirmation prompt and removes the branch immediately
{% /table %}

{% callout type="warning" %}
Removing a branch is irreversible. All data and changes in the branch will be permanently deleted.
{% /callout %}

## tb branch ls

Lists all available branches in your workspace.

```shell
tb branch ls
```

This command shows all branches you have created, along with their status and creation information.

## Working with branches

Once you create a branch, you can start working with it using the `--branch` flag with other commands:

```shell
# Start development in a branch
tb --branch=my_feature_branch dev

# Open Tinybird UI for the branch
tb --branch=my_feature_branch open
```

For more information about working with branches, see [Branches](/forward/test-and-deploy/branches).

## Environment support

{% table %}
  * Environment
  * Supported
  * Description
  ---
  * `--local`
  * ✗ No
  * Branches are not available locally.
  ---
  * `--cloud`
  * ✗ No
  * Branches are always created associated with a workspace in Tinybird Cloud.
  ---
  * `--branch=BRANCH_NAME`
  * ✗ No
  * Use `--branch` with other commands to work in a branch, not for managing branches.
{% /table %}
