The branch command helps you create, list, describe, and manage branches in Xata.

Subcommands

list

List all branches.
xata branch list [--organization <id>] [--project <id>] [--branch <id>] [--json] [-h|--help]
--organization
string
Organization ID
--project
string
Project ID
--branch
string
Branch ID
--json
boolean
Output in JSON format
-h, --help
boolean
Print help information and exit
Aliases: ls

describe

Describe a branch.
xata branch describe [--organization <id>] [--project <id>] [--branch <id>] [--json] [-h|--help] <branch name>
--organization
string
Organization ID
--project
string
Project ID
--branch
string
Branch ID
--json
boolean
Output in JSON format
-h, --help
boolean
Print help information and exit
branch name
string
required
The branch to describe
Aliases: view, show

create

Create a new branch.
xata branch create [--organization <id>] [--project <id>] [--parent-branch <id>] [--name <name>] [--instance-type <type>] [--replicas <n>] [--region <region>] [--scale-to-zero <true|false>] [--inactivity-period <minutes>] [--json] [-h|--help]
--organization
string
Organization ID
--project
string
Project ID
--parent-branch
string
Parent branch ID. Pass “None” to create a branch without a parent.
--name
string
Branch name
--instance-type
string
Type of instance for this branch
--replicas
number
Number of replicas for the branch (0-4)
--region
string
Region for the branch
--scale-to-zero
boolean
Scale to zero status for the branch (true|false)
--inactivity-period
number
Inactivity period in minutes for the branch (15|30|60|120|180)
--json
boolean
Output in JSON format
-h, --help
boolean
Print help information and exit

delete

Delete a branch.
xata branch delete [--organization <id>] [--project <id>] [--branch <id>] [--yes] [--json] [-h|--help] <branch name>
--organization
string
Organization ID
--project
string
Project ID
--branch
string
Branch ID
--yes
boolean
Do not ask for confirmation, assume yes
--json
boolean
Output in JSON format
-h, --help
boolean
Print help information and exit
branch name
string
required
The branch to delete

url

Print URL (connection string) for a branch.
xata branch url [--organization <id>] [--project <id>] [--branch <id>] [--database <name>] [-h|--help] <branch name>
--organization
string
Organization ID
--project
string
Project ID
--branch
string
Branch ID
--database
string
Database name
-h, --help
boolean
Print help information and exit
branch name
string
required
The branch to get URL for
Aliases: connection-string

checkout

Checkout a branch.
xata branch checkout [--organization <id>] [--project <id>] [--branch <id>] [--database <name>] [--json] [-h|--help] <branch name>
--organization
string
Organization ID
--project
string
Project ID
--branch
string
Branch ID
--database
string
Database name
--json
boolean
Output in JSON format
-h, --help
boolean
Print help information and exit
branch name
string
required
The branch to switch to

tree

List all branches as a tree.
xata branch tree [--organization <id>] [--project <id>] [--branch <id>] [--show-id] [-h|--help]
--organization
string
Organization ID
--project
string
Project ID
--branch
string
Branch ID
--show-id
boolean
Show branch IDs in the tree
-h, --help
boolean
Print help information and exit
Aliases: topology

get

Get a field from a branch description.
xata branch get [--organization <id>] [--project <id>] [--branch <id>] [-h|--help] <field>
--organization
string
Organization ID
--project
string
Project ID
--branch
string
Branch ID
-h, --help
boolean
Print help information and exit
field
string
required
The field to get (default: .catalog)

set

Set a field value for a branch.
xata branch set [--organization <id>] [--project <id>] [--branch <id>] [-h|--help] <field> <value>
--organization
string
Organization ID
--project
string
Project ID
--branch
string
Branch ID
-h, --help
boolean
Print help information and exit
field
string
required
The field to set
value
string
required
The value to set

wait-ready

Wait for a branch to be ready.
xata branch wait-ready [--organization <id>] [--project <id>] [--branch <id>] [--json] [-h|--help] <branch name>
--organization
string
Organization ID
--project
string
Project ID
--branch
string
Branch ID
--json
boolean
Output in JSON format
-h, --help
boolean
Print help information and exit
branch name
string
required
The branch to wait for

Global Flags

-h, --help
boolean
Print help information and exit