How To Set Up Git LFS Into Your Unity Project

Adam Reed
3 min readJul 16, 2021

GitHub allows you to store your backups in your own public/private repositories within their servers. But there is a limit to the size of the files that you are storing.

If you are needing to backup your project, but you are getting a git LFS error like this when you try…

Then you should probably use Git LFS!

Initializing Git LFS into your active project is easy!

To start, make sure that you have “Git Bash” installed. If you don’t, you can click the link below and follow along with me in an article I did on how to install Git.

Once you have “Git Bash” installed, simply go to your project folder on your computer. Right-click and select “Git Bash Here”.

Next, simply type the command below into GitBash and press enter.

git lfs install

Now, Git LFS should be initialized on your project. But it won’t track all the different file types on its own. So in order to gain access to making these changes, you’ll need to add a “.gitattributes” file.

To do this, you will need to type the command seen below into Git Bash in the same location that you should still be in from your last entered command, then press enter.

git lfs track “*.psd”

Once this is done, you should see a newly created .gitattributes file within your project files.

Open the “.gitattributes file” and replace the contents of the file with the contents in this link:

https://gist.github.com/Srfigie/77b5c15bc5eb61733a74d34d10b3ed87

Save it, and you should now be able to commit your project to GitHub!

--

--

Adam Reed

Hi, my name is Adam Reed and I am a software engineer specializing in Unity and C# development. Feel free to scroll through and check out some of my work!