How do you prevent large files from being committed accidentally?
IntermediateProductionMonorepos, large files and repository performance
Answer
A pre-receive or ruleset "file size limit" restriction (GitHub rulesets can block files over a size), a pre-commit hook such as check-added-large-files, and CI check on diff size. GitHub itself rejects files over 100 MB.
- id: check-added-large-files
args: ['--maxkb=1024']
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