Created
March 31, 2021 11:24
-
-
Save droid001/575e7e546d74295133fc8cd69a1a91dd to your computer and use it in GitHub Desktop.
Script for git which deletes local branches which are deleted remotely
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
git config --global alias.gone "! git fetch -p && git for-each-ref --format '%(refname:short) %(upstream:track)' | awk '\$2 == \"[gone]\" {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