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?
I use a git-flow esque naming scheme, so this works very safely for me:
git branch --merged | grep -e "^\s\+\(fix\|feature\)/" | xargs git branch -d
It basically looks for merged commits that start with either string fix/ or feature/.
fix/
feature/