Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save brunorsch/e74c3793ce95cd0b2e0ad12112f0fb7a to your computer and use it in GitHub Desktop.
Save brunorsch/e74c3793ce95cd0b2e0ad12112f0fb7a to your computer and use it in GitHub Desktop.
Delete all local Git branches, except develop and the current one
# You can change from develop to whatever you want to keep
git branch | grep -v "develop\|$(git rev-parse --abbrev-ref HEAD)" | xargs git branch -D
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment