Skip to content

Instantly share code, notes, and snippets.

@f-bader
Created August 17, 2023 06:33
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 f-bader/46a75465a30dd52e319d0fb56552f557 to your computer and use it in GitHub Desktop.
Save f-bader/46a75465a30dd52e319d0fb56552f557 to your computer and use it in GitHub Desktop.
Delete all branches excpect main using Powershell
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