-
-
Save hujw77/207509a097983661d1f805d51c3c2f9d to your computer and use it in GitHub Desktop.
Delete all remote branches, except master
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Replace REMOTE_NAME with your remote name (e.g. origin) | |
| git branch -r | grep REMOTE_NAME/ | grep -v 'master$' | grep -v HEAD| cut -d/ -f2 | while read line; do git push REMOTE_NAME :$line; done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment