Skip to content

Instantly share code, notes, and snippets.

@djhojd
Created December 14, 2021 12:03
Show Gist options
  • Save djhojd/dfec2ef8349252dc89f037cbffcc91ad to your computer and use it in GitHub Desktop.
Save djhojd/dfec2ef8349252dc89f037cbffcc91ad to your computer and use it in GitHub Desktop.
Delete local GIT branches that were deleted on remote repository
# https://medium.com/@kcmueller/delete-local-git-branches-that-were-deleted-on-remote-repository-b596b71b530c
git branch -vv | grep ': gone]'| grep -v "\*" | awk '{ print $1; }' | xargs -r git branch -D
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment