Created
September 10, 2013 08:52
-
-
Save sylvainraye/6506734 to your computer and use it in GitHub Desktop.
Delete all branches of a Git repo (locally and remotely) except the master branch
This file contains 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
for t in `git branch | grep -v "master"` | |
do | |
git branch -D $t | |
git push --delete origin $t | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment