Skip to content

Instantly share code, notes, and snippets.

@trobrock
Created October 17, 2012 19:52
Show Gist options
  • Save trobrock/3907722 to your computer and use it in GitHub Desktop.
Save trobrock/3907722 to your computer and use it in GitHub Desktop.
#!/bin/sh
git checkout master
remote=$1
branches=$(git branch --remote --merged master | grep $remote/ | grep -v /master)
for branch in $branches
do
branch=$(echo $branch | cut -d'/' -f2)
git push $remote :$branch
git branch -d $branch
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment