Skip to content

Instantly share code, notes, and snippets.

@sml
Created May 13, 2009 16:12
Show Gist options
  • Save sml/111105 to your computer and use it in GitHub Desktop.
Save sml/111105 to your computer and use it in GitHub Desktop.
#!/bin/sh
git remote prune origin
branch_list=$(git branch -r | grep -v HEAD | grep -v master | sed s:origin/::)
until [ -z "$1" ]
do
branch_list=$(echo "$branch_list" | grep -v $1)
shift
done
for branch in $branch_list
do
git push origin :heads/${branch}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment