A snapshot is a complete checkpoint of your Git working directory state. Unlike Git commits, snapshots are disposable restore points that live outside your repository and preserve your exact staging structure.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/mubshrx/git-snapshot/llms.txt
Use this file to discover all available pages before exploring further.
What snapshots save
Every snapshot captures three categories of changes:Staged files
Files or hunks you’ve added withgit add. The snapshot stores the staged version from the Git index, not the working tree.
git show ":$file" which reads directly from the index.
Unstaged files
Modified tracked files that haven’t been staged. The snapshot stores the working tree version - your actual file on disk.cp "$repo_path/$file".
Untracked files
New files not yet added to Git. The snapshot respects.gitignore - ignored files are never saved.
git ls-files --others --exclude-standard.
How snapshots work
When you create a snapshot:- Hash generation - An 8-character hash is generated from the current timestamp and random data
- Metadata collection - Repository info, branch, commit, and file lists are gathered
- File extraction - Full contents of all changed files are copied to a temporary directory
- Tarball creation - Everything is compressed into a
.snapshotfile
Snapshot structure
Each snapshot is a gzipped tarball containing:Naming convention
Snapshots use the format:name.hash.snapshot
- With name:
my-feature.a1b2c3d4.snapshot - Without name:
a1b2c3d4.snapshot
Non-destructive creation
Creating a snapshot never changes your working directory:- Your staged files remain staged
- Your unstaged changes remain unstaged
- Your untracked files stay untracked
- You can continue working immediately
If there are no changes to save (no staged, unstaged, or untracked files), the snapshot command exits with “No changes to save”.
Full file storage
Snapshots store complete file contents, not diffs or patches. This design choice means:- Restores always work, even after you’ve made commits
- No merge conflicts during restore
- Files are restored to their exact state
- Snapshots are independent of repository history
Repository awareness
Snapshots are tied to their source repository. The matching is done by:- Remote URL (if the repo has a remote)
- Repository path (fallback if no remote)