Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save karlhorky/dfbebe4d224b9d5fa5a8a8f49d5b4af5 to your computer and use it in GitHub Desktop.
Save karlhorky/dfbebe4d224b9d5fa5a8a8f49d5b4af5 to your computer and use it in GitHub Desktop.
Delete Local Git Branches with "Gone" Remote Branches
# https://stackoverflow.com/a/33548037/1268612
git fetch --prune && 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