Skip to content

Instantly share code, notes, and snippets.

@tinacious
Created May 5, 2023 19:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tinacious/aa7810214b8ea287b1880b664e6913f3 to your computer and use it in GitHub Desktop.
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
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