Skip to content

Instantly share code, notes, and snippets.

@renanborgez
Last active August 5, 2021 13:50
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save renanborgez/ae0f9e15d4ae990b97291fd391ea77f8 to your computer and use it in GitHub Desktop.
Save renanborgez/ae0f9e15d4ae990b97291fd391ea77f8 to your computer and use it in GitHub Desktop.
GIT Snippets
## Delete local branches already merged
git fetch --prune && git branch --merged | egrep -v "(^\*|master|develop|main)" | xargs git branch -d
## Delete local branches (with force)
git fetch --prune && git branch | egrep -v "(^\*|master|develop|main)" | xargs git branch -d -f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment