I wanted to remove all my unneeded local Git branches, but this guide I found online uses Bash. What is a more Windows native approach?
Asked
Active
Viewed 60 times
1 Answers
0
Using select-string
as a replacement for grep
and this PowerShell xargs
replacement this worked for me
,@( git branch -vv | select-string -Pattern 'origin/.*: gone]' | %{$_.toString().split(' ')[2].trim()} ) | %{&"git" "branch" "-d" $_}

Sled
- 18,541
- 27
- 119
- 168