I have many Git branches. How do I delete branches which have already been merged? Is there an easy way to delete them all instead of deleting them one by one?
kuboon's answer missed deleting branches which have the word master in the branch name. The following improves on his answer:
git branch -r --merged | grep -v "origin/master$" | sed 's/\s*origin\///' | xargs -n 1 git push --delete origin
Of course, it does not delete the "master" branch itself :)