Skip to content

Instantly share code, notes, and snippets.

@brunojppb
Created August 10, 2024 11:59
Show Gist options
  • Save brunojppb/6fa0ddb6fde908c4f2af91bbef1bea2f to your computer and use it in GitHub Desktop.
Save brunojppb/6fa0ddb6fde908c4f2af91bbef1bea2f to your computer and use it in GitHub Desktop.
Clear git branches

Clear old local branches

This helps to git your local git clean by deleting all branches, but develop, main and master:

git branch -l | egrep -v "(^\*|master|main|develop)" | xargs git branch -D
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment