Skip to content

Instantly share code, notes, and snippets.

@unsafePtr
Created August 17, 2023 10:26
Show Gist options
  • Select an option

  • Save unsafePtr/1f9da9eb19b72cbd75e8fe1d7fea45ea to your computer and use it in GitHub Desktop.

Select an option

Save unsafePtr/1f9da9eb19b72cbd75e8fe1d7fea45ea to your computer and use it in GitHub Desktop.
Windows git cleanup branches which doesn't track remote
git branch --merged | %{$_.trim()} | ?{$_ -notmatch 'dev' -and $_ -notmatch 'master' -and $_ -notmatch 'main'} | %{git branch -d $_.trim()}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment