Skip to content

Instantly share code, notes, and snippets.

@diogobaracho
Created March 9, 2016 22:41
Show Gist options
  • Save diogobaracho/699b3a52b6217642d7c1 to your computer and use it in GitHub Desktop.
Save diogobaracho/699b3a52b6217642d7c1 to your computer and use it in GitHub Desktop.
#!/bin/sh
#To delete every branch merged except branchs 'homologa' & 'master':
for b in `git branch --merged | grep -v \*`;
do
if [ "$b" != "homologa" ] && [ "$b" != "master" ]; then
echo $b;
git push --delete origin $b;
git branch -D $b;
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment