Skip to content

Instantly share code, notes, and snippets.

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 juanfernandes/70c225cf9bf963fb94df7c570bdbc976 to your computer and use it in GitHub Desktop.
Save juanfernandes/70c225cf9bf963fb94df7c570bdbc976 to your computer and use it in GitHub Desktop.
Deletes all local Git branches except the current one.
#!/usr/bin/env bash
git branch | grep -v $(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