Skip to content

Instantly share code, notes, and snippets.

@jlouros
Created November 3, 2017 10:30
Show Gist options
  • Save jlouros/1a50978dd29470e92ec0c41b1083e850 to your computer and use it in GitHub Desktop.
Save jlouros/1a50978dd29470e92ec0c41b1083e850 to your computer and use it in GitHub Desktop.
Deletes all local Git branches except 'master'
git branch | Where-Object { $_ -notmatch 'master' } | ForEach-Object { git branch "$_".Trim() -D }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment