Stash-Away - Simple Git Backups for Developers
The Problem
Every developer knows this situation:
- You're trying something new in your code
- It's not ready for a git commit
- But you don't want to lose your work
- Git stash only works on your local machine
Stash-away solves this by backing up your code to a separate git repository. Simple as that.
How It Works
The main idea: use a different repository for backups.
Your main project keeps a clean git history. Your backup repository stores all your experiments and work-in-progress code.
When you run stash-away push
:
- It saves everything (including uncommitted changes)
- Pushes to your backup repository
- Your working directory stays exactly the same
Why Not Just Use Branches?
You might ask: "Why not push to a branch in my working repository?"
Here's why a separate backup repository is better:
Customer Projects
When working on customer code, their repository often has strict rules:
- Only reviewed code can be pushed
- Branch names must follow conventions
- All commits must have ticket numbers
- CI/CD runs on every push (costing time and money)
Work Repositories
Corporate repositories usually have:
- Protected branches
- Required code reviews
- Automated security scans on each push
- Audit logs that track every change
Privacy and Compliance
With a separate backup repository:
- You control who sees your experiments
- No messy work-in-progress appears in the customer's repository
- You can delete failed attempts without trace
- Keep the backup repository private and follow all customer security rules
Important: Always create your backup repository according to your company's and customer's security policies. Keep it private and use the same security standards as the main project.
Why Use Stash-Away?
Clean Git History
Your main repository only has meaningful commits. No more "WIP" or "temporary fix" commits.
Work Anywhere
Start coding on your desktop, continue on your laptop. Your unfinished work is always available.
Never Lose Work
Set up automatic backups every hour. Even if your computer crashes, you lose maximum one hour of work.
Find Old Experiments
Remember that approach you tried three months ago? It's still in your backups, ready to use.
Real Examples
Before a risky change:
stash-away push
# Now try that experimental refactoring
End of workday:
stash-away push
# Go home, pull the backup on another machine
Before a meeting:
stash-away push
# Share the backup branch with your team
Getting Started
Installation:
# Download from: [YOUR-REPOSITORY-URL-HERE]
# Build the tool
./build.sh
# Copy to your system
cp dist/stash-away /usr/local/bin/
First time setup:
# Set your backup repository
stash-away init git@github.com:yourusername/my-backups.git
# With SSH key (for private repos)
stash-away init git@github.com:yourusername/my-backups.git --identity-file ~/.ssh/id_rsa
Daily usage:
# Create backup
stash-away push
# See all backups
stash-away list
# Compare with old backup
stash-away diff backup/2024-01-15_14-30-00
# Restore a backup
stash-away restore backup/2024-01-15_14-30-00
Terminal UI
Don't like typing commands? Use the visual interface:
stash-away tui
Use arrow keys to navigate, Enter to select. Everything is just one keypress away.
Advanced Uses
- Learning: Save your progress after each tutorial step
- Demos: Keep different versions ready for client presentations
- Team work: Share unfinished code without making commits
- Time tracking: See exactly when you worked on what
Summary
Stash-away is not a replacement for git or professional backup systems. It's a simple tool that fills the gap between "I should save this" and "This is ready to commit".
Your code deserves better than being lost or forced into bad commits. Give stash-away a try.
Stash-away is open source and available at GitHub - dmissoh/stash-away