Made a note about it 4 years ago, but it looks like the note is still pretty usefull. So one more time for en readers.
To remove all merged branches(except current -v ‘*’):
git branch --merged | grep -v '*' | xargs git branch -D
also I made such command for repo complete clean up:
alias git-clean="git branch | grep -v '*' | grep -v 'master' | xargs git branch -D && git reset --hard && git clean -d -x -f"