Created
August 17, 2023 06:33
-
-
Save f-bader/46a75465a30dd52e319d0fb56552f557 to your computer and use it in GitHub Desktop.
Delete all branches excpect main using Powershell
This file contains hidden or 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 | Select-String -NotMatch -Pattern "main" | % {$branch = $_ -replace '\s'; git branch -D $branch } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment