git-stash-sync
v1.0.6
Published
Sync your git stash across multiple machines
Maintainers
Readme
Git Stash Sync 🚀
A CLI tool to automatically track and back up Git stashes to a remote ref. Never lose your stashes again, even after resetting your laptop!
Features
✅ Track stash events via CLI
✅ Creates a compressed backup (tar.gz) of stashes
✅ Pushes stash backups to a remote ref (refs/stash-backup/<username>) when a remote exists
✅ Restores stashes when setting up a new machine
Installation
Via npm (recommended)
npm install -g git-stash-syncUsage
Sync stashes (restore)
git-stash-sync initRestores stashes from the local/remote backup. If a remote named origin exists, the backup is fetched automatically.
Restore stashes (alias)
git-stash-sync restoreAlias for init.
Backup stashes
git-stash-sync backupCreates a compressed backup of current stashes and stores it under refs/stash-backup/<username>. If origin exists, it will push the backup.
Track (optional)
git-stash-sync trackOutputs a message. You can wire this into your own hooks/aliases.
Auto sync (optional)
You can create a git alias to trigger backups after git stash operations:
git config --global alias.stash '!git stash $@ && git-stash-sync backup'Now, every time you run git stash push/pop, your stashes will be automatically backed up locally and pushed if a remote exists.
