Warning: While the recommendations here aren't inherently destructive (since they are only deleting merged branches), recovering branches you didn't mean to delete can be complicated and time-consuming. Use these techniques at your own risk!
Depending on the branching strategy in your repository, this can be fairly simple or somewhat complicated. If you want to delete all branches that have been merged into `master` then you can use this one-liner on macOS or Linux (it should also work on Windows in one of the various Unix shell extensions):
git branch --merged master | grep -v -e master | xargs -n 1 git branch -d
I hope that helps!
I just realized that I haven't been deleting my branches as I go when merging PRs. This has been an oversight for a long while, so I now have a huge set of branches that I'd like to delete. Is it possible to bulk delete branches? Or do I have to delete them all one by one?