graft reset
Reset the current (non-main) branch to match main’s current tip commit. The branch directory is replaced with main’s tree.
Usage
Behavior
- Resolve main’s tip commit hash
- Load main’s tree entries
- Stop the container
- Materialize main’s files into the current branch directory (overwriting everything)
- Move the current branch’s ref to main’s tip
- Start the container
Example
Notes
- This command only works when the active branch is not
main - The reset is destructive to the branch’s working directory but the DAG history remains intact
- To recover a reset branch’s previous state, roll back using the commit hash
Exit Codes
| Code | Meaning |
|---|---|
0 | Reset successful |
1 | Error (already on main, no commits, main not found) |