Q) Delete all Git branches which have been merged?

A)

The command git branch –merged | grep -v “*” | xargs git branch -d will delete all branches that have been merged.

Note that this will also delete local branches that have been deleted remotely but can be recovered with git branch -r .