Skip to content

Instantly share code, notes, and snippets.

@TheAmazingPT
Created March 24, 2016 14:43
Show Gist options
  • Save TheAmazingPT/72b3e1d828ac8a7ec944 to your computer and use it in GitHub Desktop.
Save TheAmazingPT/72b3e1d828ac8a7ec944 to your computer and use it in GitHub Desktop.
#!/bin/sh
git stash list
echo
read -p "Do you want to drop all these stashes? [y|n]" -n 1 confirmation
echo
case "$confirmation" in
n|N) exit 0;;
esac
echo
echo "Dropping whole git stash"
echo
stashes=$(git stash list | wc -l)
for index in $(seq 1 $stashes)
do
git stash drop
done
echo
echo "Dropped whole git stash"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment