Last active
June 17, 2022 22:50
-
-
Save unional/cf3633b95e7f71a26910f33879c4135c to your computer and use it in GitHub Desktop.
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
# update local to remove all remote-tracking branches | |
git fetch --all -p | |
# remove local branches with no remote branches | |
git branch -vv | grep ': gone]' | awk '{print $1}' | xargs git branch -D |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
pb = !git remote prune origin && git branch -vv | grep ': gone]' | awk '{print $1}' | xargs -r git branch -D