I want to delete all branches that get listed in the output of ...
$ git branch
... but keeping current branch, in one step. Is th
Assuming git branch shows the current branch prefixed with *; Using Powershell the following one liner will delete all branches that don't start with *.
git branch
*
git branch | ? { $_ -lt "*" } | % { git branch -D $_.Trim() }
? = Where-Object
?
% = Foreach-Object
%