Skip to content

Instantly share code, notes, and snippets.

@emrahyumuk
Last active May 23, 2022 08:31
Show Gist options
  • Save emrahyumuk/16e5a534febe4ab75f3c5b9d661ff44e to your computer and use it in GitHub Desktop.
Save emrahyumuk/16e5a534febe4ab75f3c5b9d661ff44e to your computer and use it in GitHub Desktop.
Delete local branches not on remote
git remote prune origin
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