Skip to main content

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.

Not in a git repository

Error: Error: Not in a git repository This error occurs when you try to run git-snapshot outside of a git repository. Solution:
  1. Navigate to a git repository directory:
    cd /path/to/your/repo
    
  2. Verify you’re in a git repository:
    git status
    
  3. If the directory isn’t a git repository, initialize one:
    git init
    

Snapshot not found

Error: Error: Snapshot 'name' not found This error appears when the snapshot you’re trying to access doesn’t exist. Solution:
  1. List all available snapshots for your repository:
    git-snapshot list
    
  2. Verify the snapshot name or hash you’re using matches exactly
  3. Check if the snapshot exists in a different repository:
    git-snapshot list --all
    

Snapshot belongs to different repository

Error: Error: Snapshot 'name' belongs to a different repository This occurs when you try to restore a snapshot that was created in a different git repository. Solution: Snapshots are repository-specific and cannot be restored across different repositories. This is by design to prevent conflicts and maintain data integrity. If you need to:
  • Use the snapshot in the original repository where it was created
  • Or create a new snapshot in your current repository
How repository matching works: git-snapshot identifies repositories using:
  1. Remote URL (if configured): git config --get remote.origin.url
  2. Repository path (fallback): The absolute path to the repository root
Snapshots match a repository if either the remote URL or the repository path matches.

Multiple snapshots match

Error: Multiple snapshots match 'query' This happens when your search query matches more than one snapshot. Solution:
  1. The tool will display a numbered list of matching snapshots with their hash, branch, and creation date
  2. For restore, show, or delete commands, you’ll be prompted to select a specific snapshot
  3. To avoid ambiguity, use the full 8-character hash instead of a name:
    git-snapshot restore a1b2c3d4
    

Unknown option error

Error: Error: Unknown option '-xyz' This occurs when using an invalid command-line option. Solution: Check the available options for the restore command:
  • --staged-only - Restore only staged changes
  • --unstaged-only - Restore only unstaged changes
  • --untracked-only - Restore only untracked files
Example:
git-snapshot restore my-feature --staged-only
For help with all commands:
git-snapshot help

Missing arguments

Error: Error: Please provide a snapshot name or hash This error appears when required arguments are not provided. Solution: Ensure you provide the snapshot identifier when using these commands:
# Show snapshot details
git-snapshot show <name-or-hash>

# Restore snapshot
git-snapshot restore <name-or-hash>

# Delete snapshots
git-snapshot delete <name-or-hash>

Rename conflicts

Error: Error: Snapshot 'new-name.hash.snapshot' already exists This occurs when trying to rename a snapshot to a name that’s already in use. Solution:
  1. Choose a different name for the snapshot
  2. Or delete the existing snapshot with that name first:
    git-snapshot delete existing-name
    git-snapshot rename old-name new-name
    

Permission issues

If you encounter permission errors when creating or accessing snapshots: Solution:
  1. Check permissions on the snapshots directory:
    ls -la ~/.local/share/git-snapshots
    
  2. Ensure you have write permissions:
    chmod 755 ~/.local/share/git-snapshots
    
  3. If using XDG_DATA_HOME, verify the environment variable:
    echo $XDG_DATA_HOME
    

No changes to save

Message: No changes to save This appears when you try to create a snapshot but have no staged, unstaged, or untracked changes. Solution: This is informational, not an error. Make some changes before creating a snapshot:
  1. Check your repository status:
    git status
    
  2. Make changes, stage files, or create new files before running:
    git-snapshot create my-snapshot
    

Snapshots directory location

By default, snapshots are stored in:
  • ~/.local/share/git-snapshots (standard)
  • $XDG_DATA_HOME/git-snapshots (if XDG_DATA_HOME is set)
To find your snapshots directory:
echo "${XDG_DATA_HOME:-$HOME/.local/share}/git-snapshots"

Build docs developers (and LLMs) love