Last active
March 12, 2025 08:52
-
-
Save jseed/5d022570ea52ee09a8f43913214496f1 to your computer and use it in GitHub Desktop.
PowerShell command to delete all branches except master
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 checkout master; git branch -D @(git branch | select-string -NotMatch "master" | Foreach {$_.Line.Trim()}) |
You are a savior!
Thank you very much!
Thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks!