Skip to content

Instantly share code, notes, and snippets.

@yfr
Forked from TheAmazingPT/git-stash-dropper.sh
Created March 24, 2016 14:47
Show Gist options
  • Save yfr/1aee9ba2fc09aa619bff to your computer and use it in GitHub Desktop.
Save yfr/1aee9ba2fc09aa619bff 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