In order to delete all branches on remote that are already merged:
git branch -r --merged | grep -v master | sed 's/origin\//:/' | xargs -n 1 git push origin
In more recent versions of Git, this command can also be used:
git branch -r --merged | grep -v master | sed 's/origin\///' | xargs -n 1 git push --delete origin