Your destination for complete Tech news

How to delete all local branches except master in Git

412 0

Sometimes we may not notice that the local branches are increasing and manually deleting branches one by one can take much time.

You can use the below code snippet in terminal to Delete all the local branches but keep the master

$ git branch | grep -v "master" | xargs git branch -D

Leave A Reply

Your email address will not be published.