Skip to content

Instantly share code, notes, and snippets.

@eralston
Created July 16, 2021 13:31
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 eralston/be18aaadf9c17cd0c0e0c76fb60f64ea to your computer and use it in GitHub Desktop.
Save eralston/be18aaadf9c17cd0c0e0c76fb60f64ea to your computer and use it in GitHub Desktop.
PowerShell utilities for Git
# Delete all branches except trunk (and current - which will error out and not be deleted even if it's not trunk)
git branch | %{ $_.Trim() } | ?{ $_ -ne 'trunk' } | %{ git branch -D $_ }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment