Last active
June 28, 2017 08:03
-
-
Save joemaffia/749e0e55978a4969e4411f6c0e64e3ca to your computer and use it in GitHub Desktop.
Delete git merged branches
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
#local | |
git branch --merged | grep -v '\*\|master\|develop' | xargs -n 1 git branch -d | |
#remote | |
git branch -r --merged | grep -v '\*\|master\|develop' | sed 's/origin\///' | xargs -n 1 git push --delete origin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment