DEV Community

loading...

Delete all local git branches from powershell

jonassamuelsson profile image Jonas Samuelsson ・1 min read

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 $_ }

Discussion (0)

Forem Open with the Forem app