Created
December 11, 2018 10:04
-
-
Save jportella93/cfa11fa92e9c5a36d9eb15ff46783afd to your computer and use it in GitHub Desktop.
Remove all your local git branches but keep 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
# Test it first: | |
# Change master by the name of the branch you want to keep, the branches showing will be eliminated | |
git branch | grep -v "master" | |
# Eliminate branches with xargs | |
git branch | grep -v "master" | xargs git branch -D |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment