Skip to content

Instantly share code, notes, and snippets.

@maraisr
Last active April 23, 2019 12:28
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 maraisr/8841d6747ae6cd498971d1aeea5bcad9 to your computer and use it in GitHub Desktop.
Save maraisr/8841d6747ae6cd498971d1aeea5bcad9 to your computer and use it in GitHub Desktop.
Clean remote branches except master
git branch -ar \
| grep origin/ \
| grep -v 'master$' \
| grep -v HEAD \
| cut -d/ -f 2- \
| xargs -I % -n 1 -P 8 sh -c "git push origin :%"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment