Forked from jseed/gist:5d022570ea52ee09a8f43913214496f1
Last active
May 23, 2023 18:52
-
-
Save benbrandt22/20163774fa5e33593b24d38e3d6da502 to your computer and use it in GitHub Desktop.
PowerShell command to delete all branches except main
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 checkout main; git branch -D @(git branch | select-string -NotMatch "main" | Foreach {$_.Line.Trim()}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment