Skip to content

Instantly share code, notes, and snippets.

@mcloide
Created October 27, 2015 13:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcloide/0a329a9b8351f74ad38b to your computer and use it in GitHub Desktop.
Save mcloide/0a329a9b8351f74ad38b to your computer and use it in GitHub Desktop.
Drop local branches which have been removed from remote.

Drop local branches which have been removed from remote.

git branch -vv | awk '/gone/ {print $1}' | xargs git branch -d`

Warning:

It uses the word gone in the output of git branch -vv so if your commit line has that it can become a false positive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment