0

I am trying to upload a Unity Project to GitHub using LFS. The size of the director is 306MB so I need to us LFS. It always freezes during the commit process which I quit with a control c. When I perform the push it goes then says "large files detected use LFS".

I perform the following steps where the directory is called "clickToMove"

git lfs install
git lfs track "clickToMove"
git add .gitattributes
git add file clickToMove
git commit -m "commitMessage"
git push origin master

I tried git lfs track "clickToMove.**" as per another Stack Overflow about the same issue I also tried doing git lfs track "clickToMove/Assets" git lfs track "clickToMove/Library" etc until all the subdirectories are tracked in the .gitattributes file

I get an error that says large files detected and to use LFS.

git error

Community
  • 1
  • 1
EFiore
  • 105
  • 1
  • 9

1 Answers1

1

You should use for example git lfs track "*.png" git lfs track "*.jpg" ... to track binary file types. Right now you are only tracking files called clickToMove. Additionally you should setup a proper .gitignore. Here you can find an example of a proper .gitignore for unity. To apply the .gitignore to your committed changes refer to this question.

allinonemovie
  • 652
  • 1
  • 6
  • 20
  • Thank you. Adding the .gitignore did work. Specifically the Unity.gitignore that GitHub already has available. But I was under the impression that lfs can already track directories. GitHub has said you can track directories. – EFiore Feb 10 '19 at 01:06
  • As far as I know you have to use `git lfs track "clickToMove/**"` for that. That wouldn't make sense in your example though, because you would track your code with git lfs as well. `git lfs track` tells git lfs which files it should treat as binary files. If that isn't correct, please update my answer. – allinonemovie Feb 10 '19 at 07:56
  • Hi, if that answer was the solution you were looking for, it would be nice if you marked it as accepted. That makes it easier to find old questions on SO without good answers. – allinonemovie Jun 12 '19 at 06:31
  • I ended up using the already supplied .gitignore and that fixed my problem. Thank you very much. – EFiore Jul 12 '19 at 15:39