<Marc Qualie/>

Remove Deleted Git Branches

Due to using to Github flow quite heavily, I end up with a lot of rogue branches locally that I'm always forgetting to cleanup. The snippet below is a quick one-liner I have aliased to cleanup-branches which saves me some time and keeps me out of branch spaghetti when autocompleting.

git --no-pager branch -vv | grep gone | awk '{print $1}' | xargs git branch -D

If you have any questions about this post, or anything else, you can get in touch on Twitter or browse my code on Github.