Cleaning up local branches in git

Published on Monday, September 1, 2014

Photo by Jan Loyde Cabrera on Unsplash

If you use posh-git, here's a command to clean up all your merged local branches:

git branch --merged | where {$_ -notmatch 'master'} | % {git branch -d $_.Trim()}