Git Academy

Advanced · 4 min read

Big files with Git LFS

Videos, designs, datasets: version them without bloating the repository.

Why

Every version of every file stays in Git forever. A few 200 MB files and every clone becomes huge — and GitHub refuses files over 100 MB.

Set up

Install the extension once, choose the patterns, commit .gitattributes.

Safe
$ git lfs install
$ git lfs track "*.mp4" "*.psd"
$ git add .gitattributes
$ git commit -m "chore: track media with LFS"

Files already committed

Tracking only applies to new commits. To move existing history to LFS, migrate (it rewrites history: coordinate with the team).

Safe
$ git lfs migrate import --include="*.mp4" --everything