Pointers for large files and repositories in Git
Published by marco on
How to Add files to a Large Repository? (Reddit)
Git has opt-in support for handling large files.
- Use the
–depthoption to control how much history to clone (good for pipelines, where you’re usually only interested in the tip, sodepth 1) - Whereas
depthcontrols how much you clone (size of the.gitfolder),sparse-checkoutcontrols the size of your working tree.
git logoUse LFS (Large File Storage) to store files. This will not remove large files from existing commits. This feature is seamless to enable and well-supported throughout the ecosystem.- Once you’ve set up LFS for future commits, you can consider removing large files from already-existing commits using something like BFG and then re-adding them with LFS.