Quick Reference
Saving Changes
Basic Stash
Stash with Message
What Gets Stashed
| File State | Stashed? |
|---|---|
| Staged changes | Yes |
| Modified tracked files | Yes |
| Untracked files | Yes |
| Deleted files | Yes |
| Ignored files | No |
Viewing Stashes
List All Stashes
Show Stash Contents
Applying Stashes
Pop (Apply and Remove)
Apply (Keep Stash)
Use
apply when you want to apply the same stash to multiple branches, or when you’re not sure if the application will succeed.Removing Stashes
Drop Specific Stash
Clear All Stashes
Common Workflows
Quick Context Switch
Apply Stash to Different Branch
Preview Before Applying
Stash Specific Files
While wit stashes all changes by default, you can stage specific files first:How wit Stash Differs from Git
| Aspect | Git | wit |
|---|---|---|
| Default message | Generic “WIP on branch” | Auto-generated with counts |
| Time display | None in list | Shows relative time |
| Apply feedback | Minimal | Clear success/failure messages |
| Show command | Requires flags for details | Shows all relevant info |
| Staged preservation | Requires —keep-index | Automatic |
Stash Internals
wit stores stashes in.wit/stash/stash.json as compressed JSON, containing:
- File contents (base64 encoded)
- File permissions
- Staged vs. unstaged status
- Branch name at stash time
- Base commit hash
Tips
Name your stashes
Name your stashes
Always use descriptive messages with
wit stash save "message" to remember what each stash contains.Check stash contents first
Check stash contents first
Use
wit stash show before popping to ensure you’re applying the right stash.Don't let stashes pile up
Don't let stashes pile up
Regularly review and clean up your stash list. Old stashes often become irrelevant.
Prefer commits for longer pauses
Prefer commits for longer pauses
If you’re stepping away for more than a few hours, consider using
wit wip to create a WIP commit instead of stashing.Troubleshooting
Stash apply conflicts
Stash apply conflicts
If applying a stash causes conflicts, resolve them manually and then drop the stash:
Wrong stash applied
Wrong stash applied
If you applied the wrong stash, you can undo:
Recovering cleared stashes
Recovering cleared stashes
Unfortunately,
wit stash clear is permanent. Consider using wit snapshot for more persistent checkpoints.Related Commands
wit wip- Create a quick WIP commit instead of stashingwit snapshot- Create named checkpointswit switch- Switch branches (auto-stashes by default)