Last active
November 27, 2018 15:03
-
-
Save benauthor/d9e899266841e409a32a2cac8a3f1df0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/bin/bash | |
args="--merged" | |
echo "delete some merged branches:" | |
{ git branch $args | grep -E -v "master|stable|prod|\*" | cut -c 3- | while read -r branchname; do | |
read -r -u 3 -p "Delete $branchname (y/n)? " answer | |
case ${answer:0:1} in | |
y|Y ) | |
git branch -d "$branchname" | |
;; | |
* ) | |
echo "$branchname not deleted" | |
;; | |
esac | |
done } 3<&0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment