Branches

⚠️ Warning: This feature is still under development and this document is likely to change unpredictably. Proceed with caution.

A powerful feature of Xata is that it facilitates rapid development through branching, similar to git. This allows teams to build products at an incredible pace while maintaining safety: what happens in branches stays in branches until they are merged to the main branch. When a branch is merged to main, Xata performs a rolling update with zero-downtime guarantees.

Creating a Branch

You can create a branch and modify your database's schema either by using the Command Line Interface (CLI) or by using the web user interface (UI). With either option, the resulting schema can be stored in source control like git before finishing your feature.

Creating a Branch using Xata's Web UI

To create a branch with the Xata Web UI,

  • Go to the Branches page.
  • Click the Create a branch button.
  • Select the source base branch (normally main).
  • Enter the name of the new branch.

We recommend naming the Xata branch the same as your feature branch in git. Once your branch is created, you can use the web user interface to add or remove tables or columns, add test data, and test your feature as you develop it using the Get Code Snippet button in your branch's table view.

From here, all that's left to do is to review and commit the schema changes to your git repository and you've got a branched workflow.

Command Line Interface (CLI)

To learn how our CLI infers branches from your git repository, please visit its usage guide.

Merging Branches

We are currently working on the functionality to merge branches. It is expected to be ready when Xata reaches General Availability. It is currently beta.

Deleting Branches

Branches in Xata are analogous to branches in git: they are to facilitate feature development and can be disposed of after a feature is merged. There are two ways to delete a branch in Xata: with the CLI and with the web UI.


Last modified 1 mo17 days ago