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
–depth
option to control how much history to clone (good for pipelines, where you’re usually only interested in the tip, sodepth 1
) - Whereas
depth
controls how much you clone (size of the.git
folder),sparse-checkout
controls 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.