Skip to content

Instantly share code, notes, and snippets.

@joshbtn
Last active August 29, 2015 14:12
Show Gist options
  • Save joshbtn/8f493b5f6a0dbfd13543 to your computer and use it in GitHub Desktop.
Save joshbtn/8f493b5f6a0dbfd13543 to your computer and use it in GitHub Desktop.
Match and remove remote branches
git push origin $(git for-each-ref --format "%(refname)" refs/remotes | cut -d"/" -f4- | grep -Eiv '(^HEAD|^master)' | awk '{print ":"$1}')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment