$ git branch | grep -v "master" | xargs git branch -D
will delete all branches except master (replace master with branch you want to keep, but then it will delete master)
$ git branch | grep -v "master" | xargs git branch -D
will delete all branches except master (replace master with branch you want to keep, but then it will delete master)