Skip to content

Instantly share code, notes, and snippets.

@PrestonII
Created May 27, 2025 15:45
Show Gist options
  • Save PrestonII/24227d9567701a841e4a5f5b21a6ddee to your computer and use it in GitHub Desktop.
Save PrestonII/24227d9567701a841e4a5f5b21a6ddee to your computer and use it in GitHub Desktop.
Remove all local branches that no longer exist on remote
git fetch -p && git branch -vv | awk '/: gone]/{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