Skip to main content

ALTER BRANCH Preview

Change the reference that the branch head points to.

Syntax
ALTER BRANCH <branch_name>
ASSIGN { REF[ERENCE] | BRANCH | TAG | COMMIT } <identifier>
[ IN <catalog_name> ]

Parameters

{{< sql-section file="data/sql/branches.json" data="alteringABranch" >}}

Examples

Assign the branch head to a specific commit
ALTER BRANCH myBranch
ASSIGN COMMIT "c7a79c74adf76649e643354c34ed69abfee5a3b070ef68cbe782a072b0a418ba"
Assign the branch head to a specific branch
ALTER BRANCH myBranch
ASSIGN BRANCH anotherBranch
IN myCatalog
Assign the branch head to a specific tag
ALTER BRANCH myBranch
ASSIGN TAG myTag
Assign the branch head to a specific reference
ALTER BRANCH myBranch
ASSIGN REF tag2