Skip to content

Instantly share code, notes, and snippets.

@rproenca
Created April 18, 2016 17:36
Show Gist options
  • Save rproenca/3acfbb2152abdcae47a2deebce049921 to your computer and use it in GitHub Desktop.
Save rproenca/3acfbb2152abdcae47a2deebce049921 to your computer and use it in GitHub Desktop.
Delete all git local branches except the ones between double quotes
git branch | grep -v "master\|develop\|release" | xargs git branch -D
@andremw
Copy link

andremw commented Apr 18, 2016

With this alias you just need to call git cb (clear branches)

git config --global alias.cb '!git branch | grep -v "master\|develop\|release" | xargs git branch -D'

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