mine stash
Track, diff, and manage your dotfiles with git-backed versioning.
Initialize
Section titled “Initialize”mine stash initCreates a stash directory at ~/.local/share/mine/stash/.
Track a File
Section titled “Track a File”mine stash track ~/.zshrcmine stash track ~/.gitconfigmine stash track ~/.config/starship.tomlCopies the file into the stash directory and tracks it for changes.
List Tracked Files
Section titled “List Tracked Files”mine stash listShows all currently tracked files with their source paths.
Check for Changes
Section titled “Check for Changes”mine stash diffShows which tracked files have been modified since last commit.
Browse Snapshot History
Section titled “Browse Snapshot History”mine stash logmine stash log ~/.zshrcShows the full snapshot history for the stash repo. Pass an optional file path to filter history to commits that touched that file.
Commit Changes
Section titled “Commit Changes”mine stash commitmine 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.
| Flag | Short | Description |
|---|---|---|
--message | -m | Commit message for the snapshot |
Restore a File
Section titled “Restore a File”mine stash restore ~/.zshrcmine stash restore ~/.zshrc --version HEAD~1mine stash restore ~/.zshrc --forceRestores a tracked file from the stash back to its source location.
| Flag | Short | Description |
|---|---|---|
--version | -v | Git ref to restore from (default: latest commit) |
--force | -f | Override 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.
Sync with Remote
Section titled “Sync with Remote”mine stash sync remote git@github.com:you/dotfiles.gitmine stash sync pushmine stash sync pullBacks up and restores the stash repo from a remote git repository.
Examples
Section titled “Examples”# Initialize stashmine stash init
# Track important config filesmine stash track ~/.zshrcmine stash track ~/.gitconfigmine stash track ~/.config/nvim/init.lua
# Check what's changedmine stash diff
# Snapshot your current statemine stash commit -m "after brew update"
# Browse snapshot historymine stash logmine stash log ~/.zshrc # history for a single file
# Restore a file to its latest snapshotmine stash restore ~/.zshrc
# Restore a file to a specific versionmine stash restore ~/.zshrc --version HEAD~2
# List all tracked filesmine stash list