Git: prune those old branches

TortoiseGit’s right-click sometimes appears to freeze.

It can be caused by too many old branches hanging around.

Here’s how to prune the ones that have been merged to master:

git branch --merged master |grep -v master | xargs git branch -d

Obviously you’ll want to make sure your master branch is up to date.

Thanks to my colleague UA for finding that one.

If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Leave a Reply

Your email address will not be published.