branch
create
Create a new empty root branch.
strata branch createdb.branches.create(name: 'str') -> 'Any'wire branch_create
Creates an empty root branch with no parent and no data. This is not a fork: the new branch starts from nothing, and its `parent` is null. Use `branch.fork` to start from an existing branch's data. Creating a name that already exists fails with `already_exists.engine.branch`; names reserved for engine control data are rejected.
Successful mutations return an acknowledgement of the outcome: for a state-changing write, the affected target with the mutation effect and commit facts; for mutations that produce a domain result (such as a branch or a promotion outcome), that result object.
To see the complete help for this command, run:
strata branch create --helphelp(db.branches.create)
Example
Create a new empty branch.
strata branch create featurestrata branch list
_ = db.branches.create("feature")sorted(b.name for b in db.branches.list())
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| branch | string | yes | Branch name. |
Returns
MutationAck<BranchItem>
- dataBranchItem
- typestring
Errors
Recover by code. Retry policy and commit outcome come from the shipped error registry.
| Code | Retry | Commit outcome |
|---|---|---|
| failed_precondition.engine.runtime_closed | never | not_started |
| invalid_argument.engine.branch_name | never | not_started |
| invalid_argument.engine.branch_name_reserved | never | not_started |
| already_exists.engine.branch | never | not_started |