-
-
Save UdjinM6/770e126a0055803bfc91 to your computer and use it in GitHub Desktop.
Remove local branches that were merged
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
# remove local | |
git branch --merged | | |
grep -v '>' | | |
grep -v master | | |
xargs -L1 | | |
cut -d"/" -f2- | | |
xargs git branch -d | |
# remove remote | |
git branch -r --merged | | |
grep -v '>' | | |
grep -v master | | |
xargs -L1 | | |
cut -d"/" -f2- | | |
xargs git push origin --delete |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment