Git - Delete All Branches, Except Master


2 min read

Deleting branches, except master

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

Setting up an alias in bash or zsh shell

1alias gbr="git branch | grep -v "master" | xargs git branch -D"
Previous post:
What Is The Interface Segregation Principle?
Next post:
What Is The Open / Closed Principle?

Discussion