Listing the Contents of your Git Stash

less than 1 minute read

I tend to keep my git stash full, between switching between different feature branches and having to pull the latest updates into git from subversion.

Often times I forget that there is something in the stash, and then forget what’s in it. Usually it’s completely useless, some local setting or debugging code that I put in at one time and no longer need.

Using:

git show $(git stash list | cut -d":" -f 1)

allows me to see what’s in the stash, to determine whether I can drop or apply it safely or not.