Delete all local git branches from powershell

Jonas Samuelsson - Sep 20 '20 - - Dev Community

I sometimes end up with a bunch of local git branches that I want to get rid of and this little bit of powershell does exactly that

git branch | %{ $_.Trim() } | ?{ $_ -ne 'master' } | %{ git branch -D $_ }
Enter fullscreen mode Exit fullscreen mode
. . . . . . . . . . . . . . . .
Terabox Video Player