Skip to content

Instantly share code, notes, and snippets.

@loiane
Created October 2, 2020 23:47
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 loiane/2e4bdf9aae73892e1a7dc2c1b1c2a517 to your computer and use it in GitHub Desktop.
Save loiane/2e4bdf9aae73892e1a7dc2c1b1c2a517 to your computer and use it in GitHub Desktop.
delete git remote branches
REMOTE="origin"
git branch -r | grep "^ ${REMOTE}/" | sed "s|^ ${REMOTE}/|:|" | grep -v "^:HEAD" | grep -v "^:master$" | xargs git push ${REMOTE}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment