Created
March 31, 2022 06:54
-
-
Save peterblazejewicz/93976cc2d9b2404e39cb89c10ab901ed to your computer and use it in GitHub Desktop.
git branch delete all but main powershell Win OS
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 for-each-ref --format '%(refname:short)' refs/heads | ForEach-Object {If($_.StartsWith("main") -eq $false) { git branch -D $_ }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment