1. mainormasterに移動する
  2. git branch --merged | grep -v '*' | xargs -I % git branch -d %

不要なブランチを削除する | ハックノート