Last Updated: February 25, 2016
·
785
· jimmithy

Git Command to Remove All Local Branches

Lots of tickets means lots of branches. I like to have a large clear out every now and again, and this seems to do the trick

git branch -D `git branch | grep -v ‘master’ | tr -d ‘\n’`

It will remove all local branches except master :)

1 Response
Add your response

good tips, however, for audiences at beginner level, use with caution

over 1 year ago ·