Created
July 28, 2018 17:41
-
-
Save jrmsklar/a8dbdf0dbf8cab8ee47a5895826234d1 to your computer and use it in GitHub Desktop.
Program for deleting git branches locally in Terminal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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