Anton Zolotov

I'm a software developer, entrepreneur and CEO of GunpowderLabs, a web and mobile development consultancy. Contact me.

Delete local git branches that have been merged into the currently checked out branch

git branch --merged | grep -v "\*" | xargs -n 1 git branch -d

This is a pain to type each time, so I made it an alias in my .zshrc:

alias git-clean-merged-branches='git branch --merged | grep -v "\*" | xargs -n 1 git branch -d'

Easy, right?


blog comments powered by Disqus