Skip to content

mine stash

Track, diff, and manage your dotfiles with git-backed versioning.

Terminal window
mine stash init

Creates a stash directory at ~/.local/share/mine/stash/.

Terminal window
mine stash track ~/.zshrc
mine stash track ~/.gitconfig
mine stash track ~/.config/starship.toml

Copies the file into the stash directory and tracks it for changes.

Terminal window
mine stash list

Shows all currently tracked files with their source paths.

Terminal window
mine stash diff

Shows which tracked files have been modified since last commit.

Terminal window
mine stash log
mine stash log ~/.zshrc

Shows the full snapshot history for the stash repo. Pass an optional file path to filter history to commits that touched that file.

Terminal window
mine stash commit
mine stash commit -m "save dotfiles after brew update"

Records the current state of all tracked files as a git commit in the stash repo. If no message is provided, a timestamp-based message is used automatically.

FlagShortDescription
--message-mCommit message for the snapshot
Terminal window
mine stash restore ~/.zshrc
mine stash restore ~/.zshrc --version HEAD~1
mine stash restore ~/.zshrc --force

Restores a tracked file from the stash back to its source location.

FlagShortDescription
--version-vGit ref to restore from (default: latest commit)
--force-fOverride the restored file’s permissions with the stash-recorded permissions (captured at track/commit time). Without this flag, the file’s existing permissions are preserved.

Without --force, the restored file keeps the current source file’s permissions (or defaults to 0644 if the source file doesn’t exist yet). Use --force when you want to restore both the content and the permissions exactly as they were when last committed.

Terminal window
mine stash sync remote git@github.com:you/dotfiles.git
mine stash sync push
mine stash sync pull

Backs up and restores the stash repo from a remote git repository.

Terminal window
# Initialize stash
mine stash init
# Track important config files
mine stash track ~/.zshrc
mine stash track ~/.gitconfig
mine stash track ~/.config/nvim/init.lua
# Check what's changed
mine stash diff
# Snapshot your current state
mine stash commit -m "after brew update"
# Browse snapshot history
mine stash log
mine stash log ~/.zshrc # history for a single file
# Restore a file to its latest snapshot
mine stash restore ~/.zshrc
# Restore a file to a specific version
mine stash restore ~/.zshrc --version HEAD~2
# List all tracked files
mine stash list