Stash vs commit vs worktree
Stash shelves temporarily on a stack, a commit records permanently on the branch, a worktree gives a second checkout for parallel work.
Aspect | Stash | Commit | Worktree |
|---|
Persistence | Stack, local | Branch | Filesystem |
Visibility | git stash list
| git log
| Filesystem path |
Sharing | No | Yes | No |
Use case | Quick context switch | Permanent history | Long parallel work |
Risk | Forgetting to pop | Clutter if WIP | Disk space |