Created
January 3, 2020 14:15
-
-
Save CyrilFind/d1997b1dd3c5c4ada78f84b5cabdfa44 to your computer and use it in GitHub Desktop.
git cleanup
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
[clean local] | |
git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d | |
[clean remote] | |
git branch -r --merged | egrep -v "(^\*|master|dev)" | 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