Skip to content

Instantly share code, notes, and snippets.

@sverweij
Last active April 18, 2024 07:45
Show Gist options
  • Save sverweij/14c5ed6e026ebd5e88b66cb2bad8b33c to your computer and use it in GitHub Desktop.
Save sverweij/14c5ed6e026ebd5e88b66cb2bad8b33c to your computer and use it in GitHub Desktop.
delete a batch of git branches
# the grep --invert-match to prevent deletion of branches you'd want to keep no matter what
git branch | grep LCM | grep --invert-match master | sed s/^/git\ branch\ -D/g | sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment