Skip to content

Instantly share code, notes, and snippets.

@peterblazejewicz
Created March 31, 2022 06:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterblazejewicz/93976cc2d9b2404e39cb89c10ab901ed to your computer and use it in GitHub Desktop.
Save peterblazejewicz/93976cc2d9b2404e39cb89c10ab901ed to your computer and use it in GitHub Desktop.
git branch delete all but main powershell Win OS
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