Have you seen this error? Files too large for Git?

Zach Lo
3 min readApr 26, 2021
Photo by Ehimetalor Akhere Unuabona on Unsplash

Have you seen this message? Chances are if you’re working in most software engineering fields you haven’t, but if you’re in games you may have seen this a few times. I recently ran into this issue, and decided to do this write up to help those having the same issue. You see an error message that looks like this…(Fig 1)

remote: error: GH001: Large files detected. You may want to try Git Large File Storage

Fig 1

Noooooo! I thought pushing to the cloud was supposed to be trouble free? Let’s all take a moment to relax, there is a solution. Git LFS, or Large File Storage, is an extension for handling large files that efficiently saves storage space on our drive.

What is it? Well in game dev we are often pushing large files to the cloud like 3d models, large textures, videos, and .psd files. These can often take up more space than just our source code. Installing Git LFS in our repository allows us to tell it what types of files it should manage for us. In a nutshell as we push files tracked by Git LFS they are stored in a separate location and will create a small text pointer file to it’s stored location that is included in our repository. This tells Git where to download this large file if we need it.

First we need to install Git LFS by going to this link (Fig 2):

Fig 2

After downloading Git LFS we simply type “git(space)lfs(space)install” in a terminal. Then we need to tell Git to track the types of large files we are referencing in this case .psd by typing a (Fig 3):

Fig 3

“git lfs track “*.psd” in the terminal. After hitting return we should see a .gitattributes file appear in our project file directory. If we double click and open this file we will see some line of text that begins with .psd (Fig 4).

Fig 4

But, wait what if I have other file types giving me LFS issues? No problem, there’s a list of common file types that return LFS errors I came across on gitHub which we can copy and paste into our existing .gitattributes file.

The next time we try to commit and push our file the error should be gone.

Till the next time!

--

--

Zach Lo

Unity Developer | Community Manager with a passion for tech and entertainment