ALTER BRANCH
Change the reference that the branch head points to.
SyntaxALTER BRANCH <branch_name>
ASSIGN { REF[ERENCE] | BRANCH | TAG | COMMIT } <reference_name>
[ IN <catalog_name> ]
Parameters
<branch_name>
String
The name of the branch that you are assigning a new reference to.
ASSIGN { REF[ERENCE] | BRANCH | TAG | COMMIT } <reference_name> String
Specifies the reference that will be assigned as the new branch head.
REF
: Identifies a new reference where the specified branch is assigned to, which can be another branch, a tag, or a commit.BRANCH
: Identifies a branch reference where the specified branch is assigned to.TAG
: Identifies a tag reference where the specified branch is assigned to.COMMIT
: Identifies a reference where the specified branch is assigned to. Commit hashes must be enclosed in double quotes (for example,“ff2fe50fef5a030c4fc8e61b252bdc33c72e2b6f929d813833d998b8368302e2”
).
IN <catalog_name>
String Optional
The name of the Arctic catalog that you want to refer to. If not specified, the current Arctic catalog in the query context is used.
Examples
Assign the branch head to a specific commitALTER BRANCH myBranch
ASSIGN COMMIT "c7a79c74adf76649e643354c34ed69abfee5a3b070ef68cbe782a072b0a418ba"
ALTER BRANCH myBranch
ASSIGN BRANCH anotherBranch
IN myCatalog
ALTER BRANCH myBranch
ASSIGN TAG myTag
ALTER BRANCH myBranch
ASSIGN REF tag2