Skip to content

Instantly share code, notes, and snippets.

@unional
Last active June 17, 2022 22:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save unional/cf3633b95e7f71a26910f33879c4135c to your computer and use it in GitHub Desktop.
Save unional/cf3633b95e7f71a26910f33879c4135c to your computer and use it in GitHub Desktop.
# 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
@unional
Copy link
Author

unional commented Jun 17, 2022

pb = !git remote prune origin && git branch -vv | grep ': gone]' | awk '{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