Last active
June 19, 2017 14:05
-
-
Save Fastjur/00e1e3ce67218533de9d206be5165af7 to your computer and use it in GitHub Desktop.
Remove all local git branches already merged in 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
git remote prune origin && (git branch --merged master | 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
If you grep for "^master$" instead of "master$", you also catch branches that end in 'master' that are not master