Pruning Stale Branches

Just a quick post on stale branches on this Black Friday. Like old docker images, Git branches that are no longer needed inevitably starts to accumulate as a by-product of everyday development.

To remove these local branches, I use the following commands:

> git remote prune origin
> git branch -vv | grep "origin/.*: gone]" | awk '{print $1}' | xargs git branch -D

And if you need to remove old docker images, check out my post on that here.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store