An alias to iterate all 1st level child folders and remove all local branches not in the safelist
alias -p bfg='for d in */; { echo $d; cd $d; { git checkout -q master; git branch | egrep -v "(^\*)|(^\s+(master|dev|hotfix|qa))" | xargs --no-run-if-empty git branch -D ; }; cd ..; };'
BEWARE: Only run if you are sure you really want to remove all branches not in the safe list - I normally do this at the end of a sprint/delivery and I know all branches are defunct other than master etc
NOTE: It can probably be improved