Git LFS is an addon to Git which provides clean handling of arbitrarily large files, (in theory) giving you the best of both Git-style DVCS and being able to track large blobs of files.
This can become necessary as Git sometimes struggles to track large files and can become unusably slow.
Migrating a repo to use LFS
tl;dr:
$ git lfs migrate import --include="*.jpg" --everything
$ git lfs ls-files --all
$ git push --all --forceHistory rewrite
This import rewrites history (due to the
--everythingflag). See the warnings at the top of Editing History.
See also
- https://josh-ops.com/posts/migrate-to-git-lfs/
- “No kill like overkill” method: https://rtyley.github.io/bfg-repo-cleaner/
Configuring a repo for ongoing LFS usage
git lfs track "*.jpg": select filetypes for LFS to manage- Make sure
.gitattributesis tracked (git add .gitattributes) - From here, just add/commit/push files as normal
- Make sure