January 04, 2021

How to remove all local git branches except master through Powershell

 git branch -D @(git branch --format '%(refname:lstrip=2)' | where {$_ -ne 'master'} )