Skip to main content

CREATE BRANCH

Create a new branch that is based on the current one that you are in.

Syntax
CREATE BRANCH [ IF NOT EXISTS ] <branch_name>
[ { FROM | AT } { REF[ERENCE] | BRANCH | TAG | COMMIT } <reference_name> ]
[ IN <catalog_name> ]

Parameters

[ IF NOT EXISTS ] Optional

When included, the command will run regardless of whether the branch exists and you will receive a summary indicating whether the branch could be created. If this clause is not specified, the command will fail if the branch to be created already exists.


<branch_name> String

The name of the branch that you are creating. If an Arctic catalog is not specified, the branch is created in the catalog specified in the query context.


{ FROM | AT } { REF[ERENCE] | BRANCH | TAG | COMMIT } <reference_name> String   Optional

Specifies the reference from which or at which you want the new branch to be created. When this parameter is omitted, the current reference is used.

  • REF: Identifies a specific branch, tag, or commit.
  • BRANCH: Identifies a specific branch.
  • TAG: Identifies a specific tag.
  • COMMIT: Identifies a specific commit. Commit hashes must be enclosed in double quotes (for example, “ff2fe50fef5a030c4fc8e61b252bdc33c72e2b6f929d813833d998b8368302e2”).

IN <catalog_name> String   Optional

The name of the Arctic catalog where you want to create a branch. If not specified, the current Arctic catalog in the query context is used.

Examples

Create a branch
CREATE BRANCH myBranch
IN myCatalog;
Create a branch at the specified commit
CREATE BRANCH myBranch
AT COMMIT "c7a79c74adf76649e643354c34ed69abfee5a3b070ef68cbe782a072b0a418ba";
Create a branch at the specified branch in the specified catalog
CREATE BRANCH myBranch
AT BRANCH anotherBranch
IN myCatalog;