Skip to content

Instantly share code, notes, and snippets.

@ozluy
Last active June 30, 2020 09:19
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 ozluy/61c022d996eb43fc83d80e0e8aaa2a26 to your computer and use it in GitHub Desktop.
Save ozluy/61c022d996eb43fc83d80e0e8aaa2a26 to your computer and use it in GitHub Desktop.

delete all local branches except master

Mac

git branch | grep -v "master" | xargs git branch -D

Windows

git branch -D @(git branch | select-string -NotMatch "master" | Foreach {$_.Line.Trim()})

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