Created
May 15, 2023 13:44
-
-
Save cristianossd/a46d1f315b165a347e1d9000ea565eb3 to your computer and use it in GitHub Desktop.
Delete git repository branches locally in a single command (bash, zsh)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# delete branches locally except main | |
alias git-delete-branches='git branch | egrep -v "(^\*|main)" | xargs git branch -D' | |
# just run git-delete-branches whenever you want |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment