Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.