Dealing with Git and Large File Storage

Sabrina Windsor
3 min readAug 11, 2021

--

So you start backing up your project to github and you get an error like this:

Well this happens because github has a file limit of 100MB. We’ll need to download and install the git large file storage if we want to back up anything of larger size. You can download it here: https://git-lfs.github.com/

Now once you download and open that file the pops up on your PC, open up git bash and type “git lfs install”

Now you’ll want to start tracking file types of the oversized files. This will create a .gitattribute file. The command for this is “git lfs track “*file type””. Mine was a .resS file, so it will look something like this:

Now if the oversized file wasn’t in any prior commits, you should be good to go and add your new files and make a new commit. In my case, I still kept getting the error, so what was wrong? Well I think my new commit was trying to overwrite a file that already existed in the repository, back before it was too big, so it wasn’t being sent to lfs.

To fix this, we need to migrate the files in the repository. Type in “git lfs migrate import — include=”*.filetype””.

Now everything should be hunky dory and your new commit should work.

Here’s some other file types that are often used with Unity, so you can go ahead and start tracking these so future you can commit in peace.

In case you come across a file type that isn’t one of these (like I did), then at least you now know what to do!

--

--

Sabrina Windsor

Currently learning to code with the help of GamedevHQ in order to someday my my game ideas come to life!