Skip to content

Instantly share code, notes, and snippets.

@jrmsklar
Created July 28, 2018 17:41
Show Gist options
  • Save jrmsklar/a8dbdf0dbf8cab8ee47a5895826234d1 to your computer and use it in GitHub Desktop.
Save jrmsklar/a8dbdf0dbf8cab8ee47a5895826234d1 to your computer and use it in GitHub Desktop.
Program for deleting git branches locally in Terminal
for branch_name in `git branch --list|sed 's/\*//g'`;
do
printf "\nWould you like to delete \e[33;4m"$branch_name"\033[0m? y for yes, n for no\n"
read answer
if [[ $answer == "y" ]]; then
git branch -D $branch_name
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment