branch

fork_at_version

Fork a new branch from a retained source commit version.

db.branches.fork(source: 'str', name: 'str', *, version: 'Optional[int]' = None, timestamp: 'Optional[int]' = None) -> 'Any'

wire branch_fork_at_version

Forks a new branch anchored at a retained commit version of the source branch, giving time-travel semantics: the new branch sees exactly the data visible at that version. A version outside retained history fails with `history_unavailable.engine.persistence_history`.

This command has no dedicated CLI verb: the CLI expresses it as `strata branch fork <SOURCE> <BRANCH> --version <VERSION>` (one shared `branch fork` verb routes to all three fork commands, so only `branch.fork` owns the CLI path). It remains fully reachable through the generic wire surface - `strata command run`, MCP, and SDKs.

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:

help(db.branches.fork)

Example

Fork a branch at an earlier commit version - a snapshot of history.

_ = db.branches.fork("default", "experiment")sorted(b.name for b in db.branches.list())

Parameters

NameTypeRequiredDescription
branchstringyesDestination branch name.
sourcestringyesSource branch name.
versionintegeryesSource version.

Returns

MutationAck<BranchItem>

  • dataBranchItem
  • typestring

Errors

Recover by code. Retry policy and commit outcome come from the shipped error registry.

← All 10 Branches commands

agents: this page as markdown → /docs/reference/branch/fork_at_version.md