graft checkout
Create a new data branch or switch to an existing one. The container is recreated with a bind mount pointing at the branch directory.
Usage
Behavior
New Branch
- Resolve parent branch’s tip commit
- Load tree entries from the DAG
- Materialize files from the object pool into the new branch directory
- Set new branch ref to parent’s tip
- Recreate container with bind mount
Existing Branch
- Resolve branch’s tip commit
- Load tree entries
- Diff current branch against target tree
- Only touch files that differ (start with unchanged files skipped)
- Prune empty directories
- Recreate container with bind mount
Flags
Examples
Create a New Branch
Switch to Existing Branch
Materialization
Checkout uses diff-based materialization. Graft walks the current branch directory, hashes every file, and compares the result against the target tree. Only files that are:- Added — Copied from the object pool
- Removed — Deleted from the branch directory
- Changed — Replaced with the correct blob from the object pool
- Unchanged — Left in place