Created
April 4, 2019 18:31
-
-
Save pragmat1c/125cdb06e56a7e8d790f070121d775bf to your computer and use it in GitHub Desktop.
Prune local git branches that don't have a remote branch. I use this to clean up the branches I've committed and merged every so often.
This file contains hidden or 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
#In your .gitconfig | |
[alias] | |
prune-branches = !git remote prune origin && git branch -vv | grep ': gone]' | awk '{print $1}' | xargs -r git branch -D |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment