Skip to main content

graft delete

Delete a branch, removing its DAG commits, tree entries, ref, and branch directory.

Usage

Behavior

  1. Drop the branch ref from SQLite
  2. Delete all commits belonging to the branch
  3. Delete all tree entries for those commits
  4. Remove the branch directory from ~/.graft/<project>/branches/<name>/
  5. Remove the branch from the state file

Examples

Notes

  • Cannot delete the main branch
  • 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 gc command will prune orphan blobs.
  • The branch’s DAG history is permanently removed

Exit Codes