Skip to content

Instantly share code, notes, and snippets.

@sogoagain
Last active February 27, 2023 07:25
Show Gist options
  • Save sogoagain/334738cfca34f4d4974dd8063fb059d9 to your computer and use it in GitHub Desktop.
Save sogoagain/334738cfca34f4d4974dd8063fb059d9 to your computer and use it in GitHub Desktop.
Tips for Using Git
# 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