Created
July 22, 2022 09:46
-
-
Save karlhorky/dfbebe4d224b9d5fa5a8a8f49d5b4af5 to your computer and use it in GitHub Desktop.
Delete Local Git Branches with "Gone" Remote Branches
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
# https://stackoverflow.com/a/33548037/1268612 | |
git fetch --prune && for branch in $(git branch -vv | grep ': gone]' | awk '{print $1}'); do git branch -D $branch; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment