Skip to content

Instantly share code, notes, and snippets.

@MikaelElkiaer
Created January 17, 2019 12:15
Show Gist options
  • Save MikaelElkiaer/44647227cbb3cfcfd3dd4b908e309fdf to your computer and use it in GitHub Desktop.
Save MikaelElkiaer/44647227cbb3cfcfd3dd4b908e309fdf to your computer and use it in GitHub Desktop.
Git prune branches
git remote prune origin ; git branch -vv | ForEach-Object { if($_ -match "^[\s\*]\s(.*)\s+\w{7}.*(?:gone).*$") { git branch -D $Matches[1] } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment