Skip to content

Instantly share code, notes, and snippets.

@paulscott
Created October 23, 2018 17:38
Show Gist options
  • Save paulscott/38d94db0c6fac1cdc18e8d4c4ca6d361 to your computer and use it in GitHub Desktop.
Save paulscott/38d94db0c6fac1cdc18e8d4c4ca6d361 to your computer and use it in GitHub Desktop.
One-liner to prune local branches whose remote tracking branch has been deleted
git branch -vv | grep ': gone]' | cut -f 3 -d ' ' | xargs -n1 git branch -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment