---
last_updated: "2026-09-11T23:22:55.000Z"
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
  ---
  * --wait / --no-wait
  * Waits until the branch is ready before exiting, including the `--last-partition` copy. Default: `--wait`
  ---
  * --ignore-datasource
  * Deprecated. Ignored with a warning. Use `tb branch create` without this flag.
{% /table %}

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

`--with-connections` isn't an option on `tb branch create`. To bring connector Data Sources into a branch, create the branch first, then build it with the flag:

```shell
tb branch create my_feature_branch --last-partition
tb --branch=my_feature_branch build --with-connections
```

`tb branch create` doesn't exit until the `--last-partition` copy has finished, so the build runs with production data already in place. See [Test with connector data](/forward/core-concepts/branches#test-with-connector-data).

## 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 and deletes all data and changes in the branch.
{% /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/core-concepts/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 %}
