Skip to content

Instantly share code, notes, and snippets.

@harshbaid
Created July 16, 2025 18:33
Show Gist options
  • Select an option

  • Save harshbaid/4648ebdb8728d3934993d6c7cbb34490 to your computer and use it in GitHub Desktop.

Select an option

Save harshbaid/4648ebdb8728d3934993d6c7cbb34490 to your computer and use it in GitHub Desktop.
Clean up outdated branches in local
git fetch -p; git branch -vv | Where-Object { $_ -match ": gone]" } | ForEach-Object { git branch -D ($_.Trim() -split '\s+')[0] }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment