Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save martijnburgers/da4b155b1a9b5fa954c02949fba751a2 to your computer and use it in GitHub Desktop.
Save martijnburgers/da4b155b1a9b5fa954c02949fba751a2 to your computer and use it in GitHub Desktop.
Windows delete all branches except master
PS: git checkout master; git branch -D @(git branch | select-string -NotMatch "master" | Foreach {$_.Line.Trim()})
CMD with C:\Program Files\Git\usr\bin in your path: git branch | grep -v "master" | xargs git branch -D
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment