Ok so, now I went through a lot of pain to try to get this working, LFS is a nightmare if you don’t know what you are doing and I still haven’t fixed the issue.
So I managed to use BFG to cleanup the whole repository doing this:
(First of all you need to download BFG from the link above, it’s on the right side, call it from the location you place it in, in my case I renamed it “bfg.jar” and placed it in my repo’s root folder, where the .git is located)
- java -jar bfg.jar --delete-files .umap “D:\Projects\UnrealProjects\MasterOfShadows”
- java -jar bfg.jar --delete-files .uasset “D:\Projects\UnrealProjects\MasterOfShadows”
- git reflog expire --expire=now --all && git gc --prune=now --aggressive
And after that last call to call the garbage collector, I tried to re-track all my files:
(deleted my .git/lfs folder and .gitattributes file)
- git lfs uninstall
- git lfs install
- git lfs track “Content/Static/**”
- git rm --cached -r .
- git add .
After this I thought that my tracked files would be all good now (which they do seem to be ok) but I noticed that on my .git/lfs folder I track some empty folders, and after trying to push I get this error:
Trying to push "Content/Static/Geometry/Meshes/1M_Cube.uasset" with OID f471a994148db424160e6589509afbe29b9205f5db07ab4c231811aefccff955. Not found in D:\Projects\UnrealProjects\MasterOfShadows\.git\lfs\objects\f4\71.
Which indeed is not on that folder, so re-tracking is not really working, looks like the file in LFS is keeping it’s old OID instead of generating a new one.
I do keep a backup but my .git/lfs
folder has a size of 2.55 GB, compared to my new one that is just 97 MB so I could say that I’m indeed duplicating a lot of unnecessary assets.
Any help on how to re-track my files properly would be appreciated, I don’t think that starting a new repository as you suggested would be of any help since the tracking remains on the .git/lfs
, or can you explain what you mean by creating a new repository? (do you mean that I should create a backup -> delete .git repo and init a new one?)
Sorry for the long text, I just wanted to share my issues with the rest of the group in case anyone else happens to have the same issue.