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
# Excludes master, by default; other branches can be added with an additional pipe i.e. | grep -v dev | |
# Update "[branch_to_check_against]" to be the branch where the to-be-pruned branches have been merged into (by default, this is master) | |
# Adapted from http://stackoverflow.com/a/18143078/1569595 | |
git pull && git branch --merged [branch_to_check_against] | grep -v "\*" | grep -v master | grep -v [branch_to_check_against] | xargs -n 1 git branch -d |