Skip to content

Instantly share code, notes, and snippets.

@moiseshilario
Created November 29, 2018 15:54
Show Gist options
  • Save moiseshilario/d272d690c14a889908ee82891fd54a78 to your computer and use it in GitHub Desktop.
Save moiseshilario/d272d690c14a889908ee82891fd54a78 to your computer and use it in GitHub Desktop.
Delete local branches (git)
# Delete branches that are already merged (but master/development/stage)
git branch --merged | egrep -v "(^\*|master|development|stage)" | xargs git branch -d
# Delete all local branches (but master/development/stage)
git branch | egrep -v "(^\*|master|development|stage)" | xargs git branch -D
@fabricionaweb
Copy link

image

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