0

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?

Sled
  • 18,541
  • 27
  • 119
  • 168

1 Answers1

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