Created
November 3, 2017 10:30
-
-
Save jlouros/1a50978dd29470e92ec0c41b1083e850 to your computer and use it in GitHub Desktop.
Deletes all local Git branches except 'master'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git branch | Where-Object { $_ -notmatch 'master' } | ForEach-Object { git branch "$_".Trim() -D } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
based of: https://gist.github.com/maurobringolf/b8840bccc4162ce423410b5ba3df6520#file-delete-all-git-branches-except-current-sh