Skip to content

Instantly share code, notes, and snippets.

@JanGorman
Created August 2, 2021 08:45
Show Gist options
  • Save JanGorman/1aa702e1865357b13e143e0ac767f760 to your computer and use it in GitHub Desktop.
Save JanGorman/1aa702e1865357b13e143e0ac767f760 to your computer and use it in GitHub Desktop.
Find that big branch
git for-each-ref --format='%(refname)' |
while read branch
do
size=$(git rev-list --disk-usage --objects HEAD..$branch)
echo "$size $branch"
done |
sort -n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment