I want to delete all branches that get listed in the output of ...
$ git branch
... but keeping current branch, in one step. Is that possible? If so, how?
$ git branch | grep -v "master" | xargs git branch -D
will delete all branches except master (replace master with branch you want to keep, but then it will delete master)
1.4m articles
1.4m replys
5 comments
57.0k users