|
|
|
|
|
by btschaegg
2092 days ago
|
|
Something I just thought of: If you've GCd your repo and you're sure there are no references to old commits laying around (also keep in mind remote branches and so on!), this might help you discover large objects that are still in your "new" history: If run in bash, this should print the 20 largest objects in your repo and their size (in bytes): git rev-list --all \
| xargs -n1 git ls-tree -r \
| awk '$2 == "blob" { print $3 }' \
| sort -u \
| while IFS= read blob; do
echo "$blob $(git cat-file blob $blob | wc -c)";
done \
| sort -rnk2,2 \
| head -20
If you find some blob that is too large, you could then search for its name like this: large_blob=<blob_id>
git rev-list --all \
| xargs -n1 git ls-tree -r \
| fgrep $large_blob
|
|