Giving your Git stash a name
Posted 5th February 2021 in Git
Out of the box,
git stash will automatically name the stash as follows:
- Stash index number
- The branch you were on when the changes were stashed
- The commit hash commit name before the stash was created
Number 3 isn’t all that useful if you’re not planning on applying your stash any time soon. I prefer to name the stash more descriptively so that if I pick it up in, say, a month’s time, I’ll have a good idea of what I was doing.
git stash save "Nicely descriptive name of the stash"
Now, when I’m looking over my list of stashes, I’ll be able to remember what each one was for.