Search
ctrl/
Ask AI
Light
Dark
System

BranchesNew

This section describes the administrative commands pertaining to branches.

Create a new branch without schema or data.

create empty branch name ;

The command create empty branch creates a new EdgeDB branch without schema or data, aside from standard schemas.

Create a new empty branch:

Copy
create empty branch newbranch;

Create a new branch copying the schema of an existing branch.

create schema branch newbranch from oldbranch ;

The command create schema branch creates a new EdgeDB branch with schema copied from an already existing branch.

Create a new schema branch:

Copy
create schema branch feature from main;

Create a new branch copying the schema and data of an existing branch.

create data branch newbranch from oldbranch ;

The command create data branch creates a new EdgeDB branch with schema and data copied from an already existing branch.

Create a new data branch:

Copy
create data branch feature from main;

Remove a branch.

drop branch name ;

The command drop branch removes an existing branch. It cannot be executed while there are existing connections to the target branch.

Executing drop branch removes data permanently and cannot be undone.

Remove a branch:

Copy
drop branch appdb;

Rename a branch.

alter branch oldname rename to newname ;

The command alter branch … rename changes the name of an existing branch. It cannot be executed while there are existing connections to the target branch.

Rename a branch:

Copy
alter branch featuer rename to feature;