Git delete all branches except master

59

git delete all branches except master -

git branch | grep -v "master" | xargs git branch -D

git remove all branches except master windows -

git branch | %{ $_.Trim() } | ?{ $_ -ne 'master' } | %{ git branch -D $_ }

Remove all your local git branches but keep master -

git branch | grep -v “master” | xargs git branch -D

how to delete all branches in git except master -

$ git branch | grep -v '^*' | xargs git branch -D

Comments

Submit
0 Comments