wit snapshot
Create quick checkpoints of your working directory without making a full commit. Perfect for “save game” moments before risky operations.
Overview
Snapshots capture the current state of all files in your working directory, storing them in the object database. Unlike commits, snapshots:
- Don’t require staged changes
- Don’t appear in history
- Can be created and restored instantly
- Are stored locally only
Usage
Commands
Create
Create a new snapshot of your working directory:
Output:
List
Show all available snapshots:
Output:
Restore
Restore files from a snapshot:
Output:
Restoring a snapshot overwrites files in your working directory. Make sure to commit or snapshot your current state first if needed.
Delete
Remove a snapshot:
Use Cases
Before Risky Changes
Quick Experiments
Debugging Sessions
Snapshots vs Stash vs Commits
Storage
Snapshots are stored in:
.wit/snapshots.json - Metadata (names, timestamps, file lists)
.wit/objects/ - File contents (as blobs)
Snapshots use the same content-addressable storage as commits, so identical files aren’t duplicated.
Tips
Use descriptive names for snapshots you plan to keep. The auto-generated ID is hard to remember.
Snapshots are recorded in the journal, so you can see your snapshot history with wit journal.