Skip to content

Instantly share code, notes, and snippets.

@DariuszPorowski
Created June 18, 2022 00:22
Show Gist options
  • Select an option

  • Save DariuszPorowski/adc7b4f1866c54022b07ddc77f3e9317 to your computer and use it in GitHub Desktop.

Select an option

Save DariuszPorowski/adc7b4f1866c54022b07ddc77f3e9317 to your computer and use it in GitHub Desktop.
Clean up local Git branches that have been deleted on the remote (PowerShell)
git fetch -p; git branch -vv | ?{ $_ -match ': gone]' } | %{ $_.Trim().Split(' ')[0] } | %{ git branch -D $_ }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment