Skip to content

Instantly share code, notes, and snippets.

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