How do you find the largest objects in a repo?
IntermediateProductionMonorepos, large files and repository performance
Answer
List all objects with sizes and sort. git-sizer gives a health report on commits, trees, blobs and refs.
git rev-list --objects --all \
| git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' \
| sort -k3 -n -r | head -20
git sizer --verbose
More on Monorepos, large files and repository performance
What are the main trade-offs of a monorepo?IntermediateHow do you make CI efficient in a monorepo?AdvancedHow do you onboard developers to a very large repo without a 30-minute clone?IntermediateWhat does Scalar do and when do you recommend it?Advanced`git status` takes 20 seconds in a big working tree. How do you fix it?AdvancedWhen should a team adopt Git LFS and when should it avoid it?Intermediate