[Git] How to Remove All Local Git Branches but Keep master and development

To delete all of your local git branches except master and development run following command
Command :

git branch | grep -ve "master\|development" | xargs git branch -D

Leave a Reply

Your email address will not be published.

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.