Quickly tidy up old git branches

How to quickly tidy up your local and remote git branches

I am always forgetting how to tidy up my orphaned git branches, which over time can cause various apps which care about the branches you have to become sluggish.

Clean merged branches

This will remove references to local branches which have been merged.

Replace master and dev or add additional branches that you care about to not want to get deleted regardless of merge status.

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

Clean up remote branches

This will remove references to deleted upstream branches.

  git remote prune origin

Recent posts View all

Talk CSS

FrontEnders - Web Performance

Sharing some of my thoughts on a FrontEnders meetup on the topic of Web Performance

Conferences

Tips for how to ask for time off to attend conferences

Asking for time off to attend a conference can be nerve-racking, these tips will get you closer to attending the conferences you're interested in.