Skip to content

Instantly share code, notes, and snippets.

@ekuzmichev
Last active August 9, 2024 12:57
Show Gist options
  • Save ekuzmichev/6faf11579b9ab1cd68d9428e645c44f3 to your computer and use it in GitHub Desktop.
Save ekuzmichev/6faf11579b9ab1cd68d9428e645c44f3 to your computer and use it in GitHub Desktop.
GIT: Remove all local branches that do not exist (gone) on remote
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