Skip to content

Instantly share code, notes, and snippets.

@rhuanbarreto
Created November 16, 2018 14:09
Show Gist options
  • Save rhuanbarreto/373b80a91bce492d8155b6ea3e352bea to your computer and use it in GitHub Desktop.
Save rhuanbarreto/373b80a91bce492d8155b6ea3e352bea to your computer and use it in GitHub Desktop.
Delete all local untracked branches from git
git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment