Skip to content

Instantly share code, notes, and snippets.

@blendax78
Created April 14, 2014 17:12
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 blendax78/10666383 to your computer and use it in GitHub Desktop.
Save blendax78/10666383 to your computer and use it in GitHub Desktop.
Remove extra Git branches (other than develop & master)
#!/bin/bash
ls="$(ls)"
for i in $(git branch)
do
if [[ "$i" != "develop" && "$ls" != *$i* && "$i" != "master" ]]
then
echo "Removing $i..."
git branch -D $i
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment