Skip to content

Instantly share code, notes, and snippets.

@giammin
Created May 25, 2021 08:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save giammin/1fd1e96d11805b5fbe36a9acc543110a to your computer and use it in GitHub Desktop.
Save giammin/1fd1e96d11805b5fbe36a9acc543110a to your computer and use it in GitHub Desktop.
sort git branches by size with powershell script
git for-each-ref --format='%(refname)' | ForEach-Object { $size = git rev-list --disk-usage --objects HEAD..$_; Write-Output "$size $_" } | Sort-Object -D
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment