AI Hints
Home›Git & GitHub Tutorial›Common Errors
Git & GitHub · Lesson 103 of 144

Big Files

And Git LFS.

⏱ 2 min read▶ Video at 1:53:16🎓 Free
Watch this lesson in the Git & GitHub courseWatch on YouTube ↗Full Git & GitHub course

Git is built for text files, like code. It's not great with huge files, like videos, design files, or datasets. Every version of every big file is kept forever, so the repository becomes slow, and very large.

Big Files
From the video: Big Files
  • Git loves text files
  • Huge files slow it down
  • Every version is kept forever

What to do with big files

First, don't commit things you can recreate, like build outputs, or downloaded packages. Put them in dot git ignore. GitHub blocks files bigger than one hundred megabytes anyway. For big files you really need, like images in a game, use Git LFS, which stands for large file storage.

Ignorebuilds and packages
GitHub limit100 MB per file
Git LFSlarge file storage
Store elsewheredatasets, videos

How Git LFS works

With Git LFS, the repository stores a tiny pointer file instead of the big file. The real file lives on a separate server. You set it up once with git lfs install, then tell it which files to manage, like git lfs track, star dot PSD. After that, you add and commit as usual.

keyvalue
git lfs installonce per computer
git lfs track "*.psd"choose file types
Repositorystores small pointers
Big filesstored separately

Summary

Keep big, generated files out of Git, and use Git LFS for large files you really need. Next, old commands you'll see in online answers.

Key takeaways
  • Ignore generated files
  • 100 MB limit on GitHub
  • git lfs track
Next up: Old Commands You'll See Online — git checkout