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 --force

History rewrite

This import rewrites history (due to the --everything flag). See the warnings at the top of Editing History.

See also

Configuring a repo for ongoing LFS usage

  • git lfs track "*.jpg": select filetypes for LFS to manage
    • Make sure .gitattributes is tracked (git add .gitattributes)
    • From here, just add/commit/push files as normal

git