Last active
October 24, 2021 23:47
-
-
Save mitchdenny/72dd41563c8c114addd9ab1a706e9e70 to your computer and use it in GitHub Desktop.
PowerShell one-liner to clean up all the branches in your local clone except for master. Be careful!
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 | % { $_.Replace("*", "").Trim() } | where { $_ -ne "main" } | % { git branch -D $_ } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment