Skip to content

Instantly share code, notes, and snippets.

@uxder
Last active August 12, 2019 21:24
Show Gist options
  • Save uxder/64ecfab0421ee6a0aeb2156739d38c31 to your computer and use it in GitHub Desktop.
Save uxder/64ecfab0421ee6a0aeb2156739d38c31 to your computer and use it in GitHub Desktop.
Git Commands
# Delete all branches that contain 'search_keyword'
git branch | grep 'search_keyword' | xargs git branch -D
# Delete all branches that have already merged into master or staging
git branch --merged | egrep -v "(^\*|master|staging)" | xargs git branch -D
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment