graft delete
Delete a branch, removing its DAG commits, tree entries, ref, and branch directory.
Usage
Behavior
- Drop the branch ref from SQLite
- Delete all commits belonging to the branch
- Delete all tree entries for those commits
- Remove the branch directory from
~/.graft/<project>/branches/<name>/ - Remove the branch from the state file
Examples
Notes
- Cannot delete the
mainbranch - Cannot delete the currently active branch — switch to another branch first
- Object pool blobs are not removed (they may be shared with other branches). A future
graft gccommand will prune orphan blobs. - The branch’s DAG history is permanently removed
Exit Codes
| Code | Meaning |
|---|---|
0 | Branch deleted |
1 | Error (is main, is active, not found) |