Last active
February 27, 2023 07:25
-
-
Save sogoagain/334738cfca34f4d4974dd8063fb059d9 to your computer and use it in GitHub Desktop.
Tips for Using Git
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
# How to delete the local branches for which the remote tracking branches have been pruned. | |
git branch -vv | grep ': gone]' | awk '{print $1}' | xargs git branch -d | |
# To delete all local Git branches except the master branch | |
git branch | grep -v "master" | xargs git branch -d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment