Why I Stopped Using git stash (and the single rule that saved my mornings)

I ditched git stash for a simple rule: if a context switch takes >15 minutes, make a WIP commit (locally or to a private remote) and use git worktrees. Practical steps, failures, and the ₹300 VPS trick.

Written by: Arjun Malhotra

A laptop angled on a wooden desk showing a code editor and terminal on screen
Photo by Brian McGowan on Unsplash

It was 9:12 AM, my manager pinged that payments had started failing on master and I had to switch branches right now. I did what I’d always done: git stash, checkout master, fix, run tests, checkout back, git stash pop.

Except this time pop failed with conflicts. I resolved two files, built, and pushed. An hour later I noticed a missing log statement I’d added before stashing. The stash had quietly dropped a file. I spent another 40 minutes piecing together fragments from editor undo, bash history, and the gh CLI. I was late for lunch and extra apologetic in a Bengaluru Slack channel I didn’t even own.

That was the last time I treated git stash like a safety net.

Why stash kept failing me

Stash is great for tiny, throwaway changes. But it has several qualities that make it fragile in day-to-day multitasking:

One rule that fixed it

I replaced stash with one rule: if switching contexts will take more than 15 minutes, make a WIP commit instead of stashing. And if I can’t push to origin quickly (slow office Wi‑Fi, on mobile data), I push the WIP to a private bare repo on a cheap VPS I control (₹300–₹400/month). The mechanics are basic, but the discipline matters.

Why this works:

How I actually do it (short, practical)

  1. Small change (<15 minutes): stash is fine. Quick experiment, throwaway tweak.
  2. Bigger change (>15 minutes) or interrupted work: commit locally to a WIP branch.

Commands I use as aliases:

My VPS is just a ₹300/month small droplet. It’s private, SSH-only, and I prune old branches once a week. When I’m on mobile data, I avoid pushing; the local WIP commit + worktree is enough. When I reach home Wi‑Fi, I push and continue.

Two small conventions that saved me more time than I expected:

The honest failure and tradeoffs

This doesn’t come without cost.

Once, in a hurry, I committed a secret API key into a WIP commit and pushed to my VPS. I realised within 30 minutes and had to rotate keys, update configs, and run a few fire-drills. That taught me three lessons: use .gitignore and commit hooks, never push secrets to any remote (private or not), and make a habit of scanning the diff before any push.

Another time, my office network was so slow that pushing even a 2MB WIP (lots of small binary files) cost precious mobile data. I’d switched to WIP commits thinking I’d push later — and then lost time when I had to share the state with a teammate. So I added a micro-rule: if work includes binaries >1MB, make a local WIP and copy the necessary files to a shared Google Drive or use rsync over my home network when I’m back.

Finally, there were days stash was indeed faster. For a five-line change, typing git stash is still quicker than thinking through branches. My rule is deliberately simple so I don’t over-engineer: stash for throwaway tweaks; commit for anything that matters.

Why this mattered in India

Two practical constraints pushed me to this workflow:

What I walked away with

I stopped treating stash as a safety net and started treating commits as the truth — temporary, explicit, and findable. That one small rule (15 minutes) cut my morning recovery time, prevented the “where did my changes go?” panic, and made collaboration less awkward when I had to hand off.

If you try this, be paranoid about secrets and set a small hygiene habit (pre-push diff review). That single tiny friction — looking at the diff before pushing — is what keeps the rest of the workflow safe.