Skip to content

Instantly share code, notes, and snippets.

@l1x
Created March 15, 2021 12:54
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 l1x/e6e704c46bf3dd54dc570e8829fa09fc to your computer and use it in GitHub Desktop.
Save l1x/e6e704c46bf3dd54dc570e8829fa09fc to your computer and use it in GitHub Desktop.
git config --global alias.sweep
git config --global --replace-all alias.sweep '!git branch --merged $([[ $1 != "-f" ]] \
&& git rev-parse master) | egrep -v "(^\*|^\s*(main|master|develop)$)" \
| xargs git branch -d'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment