Skip to content

Instantly share code, notes, and snippets.

@jseed
Last active February 7, 2024 10:01
Show Gist options
  • Save jseed/5d022570ea52ee09a8f43913214496f1 to your computer and use it in GitHub Desktop.
Save jseed/5d022570ea52ee09a8f43913214496f1 to your computer and use it in GitHub Desktop.
PowerShell command to delete all branches except master
git checkout master; git branch -D @(git branch | select-string -NotMatch "master" | Foreach {$_.Line.Trim()})
@icodeintx
Copy link

Thank You!

@andrewchaa
Copy link

Thanks!

@anujpradhaan
Copy link

You are a savior!

@data-miner00
Copy link

Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment