Setup Git large file with unity
Objective: how to Allow git to push the large files to GitHub.
Before doing that you need to understand the limit GitHub allows pushing files, its actual 100MB per file. More than that GitHub will hang up the push process.
When we try to push we get this error telling us the file exceeds the Github’s files size limit of 100.0 MB.
The first step is to go to the git lfs page and download the lfs extension. This file will allow git to push the large files to Github.
Now Instal git large file to our machine, double click and follow the step below.
In the next step, we need to install lfs to our local project, we do this by running the command “git lfs install”.
Then add the file we need to be tracked to the git lfs, we use this command git lfs track “*.psd” or git lfs track “*.asset” to specialize the extension we want to track or add to git lfs.
see the example of how the extension is displayed :
here is how we add this extension to be tracked since it will include all kinds of these files.
After those steps, we need to create the “.gitattributes” file and the truck files we need. A gitattributes file is a simple text file that gives attributes to pathnames. We do this by command “.gitattributes”.This command will create that file and add the files we track
But there are other common files, that need to be tracked by git LFS, find the link of .gitattributes which is work done for us copy all extensions then paste them to the .gitattributes text file in the root of your project.
Hence we have generated other files we need to add them all to be tracked before you push, add this file by using git add.
Commit the changes, we need to make sure we give a proper comment, we use git commit -m “”.
Last push to the Github repo.