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
  • 17,743
  • 27
  • 115
  • 155

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
  • 17,743
  • 27
  • 115
  • 155