/bio/skills/blog/math

Cull

Sometimes I get some cruft in my development environment. I’m a big fan of git stashes. Git stashes allow you to try insanely weird shit and never worry about committing it and pushing it and getting laughed at. Although, to be fair, no one ever reads your repo. You are not that important.

Still, it’s empowering to imagine you are. As such, here’s how to clear the cruft:

  • First of all, don’t commit it. If you’re having fun with bad ideas, at least stop yourself before doinggit commit -m "this is probably terrible, but it was fun!"
  • Stage it:
    • git add .
  • Stash it:
    • git stash save "delete this shit"
  • Drop that stash:
    • git stash drop
  • OR Be weird (optional)
    • git stash drop stash`git stash list | grep "delete this shit" | sed 's/stash\(@{[0-9]*}\).*/\1/'`

That last part is a specialty for all you regex nerds out there. It’ll error if stash “delete that shit” isn’t found.

2025 Stefano De Vuono