I want to delete all branches that get listed in the output of ...
$ git branch
... but keeping current branch, in one step. Is th
So I see a lot of hard coded branch names here... And I think my answer here is more accurate to the "current branch" part of the question whilst keeping it single line and readable to bash newbies like me. Just to place credit where it's due, the answer is rather obviously also based on @pankijs's answer.
git branch | grep -v $(git branch --show-current) | xargs git branch -d
and I have it aliased on one line in my .bash_aliases in debian aswell.
alias gitbclean='git branch | grep -v $(git branch --show-current) | xargs git branch -d'
(Though I thinks some bash features need to be enabled for the sub command to run on some command lines)