DEV Community

Discussion on: How to delete all your local branches but keep master

Collapse
 
chiangs profile image
Stephen Chiang

Here's one if you want to keep both master and develop:

> git branch | grep -v "master\|develop" | xargs git branch -D
Enter fullscreen mode Exit fullscreen mode
Collapse
 
ben profile image
Ben Halpern

πŸ‘Œ