Skip to content

Instantly share code, notes, and snippets.

@ultim8k
Created September 1, 2019 18:03
Show Gist options
  • Save ultim8k/228d34520f30ac45227a797e09676e03 to your computer and use it in GitHub Desktop.
Save ultim8k/228d34520f30ac45227a797e09676e03 to your computer and use it in GitHub Desktop.
Deletes local git branches which have been deleted on the remote host
git fetch -p && for branch in `git branch -vv | grep ': gone]' | awk '{print $1}'`; do git branch -D $branch; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment