Created
May 5, 2023 19:51
-
-
Save tinacious/aa7810214b8ea287b1880b664e6913f3 to your computer and use it in GitHub Desktop.
Bash function to add to your .bash_profile or .zshrc that collects git branches to be deleted via standard in
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
gitcleanup() { | |
echo 'Paste git branches to be deleted below then press enter...\n' | |
while read line | |
do | |
if [ -n "$line" ]; then | |
echo "\n" | |
git branch -D $line | |
echo "\n" | |
fi | |
done < "${1:-/dev/stdin}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment