0

I am trying to migrate history for a repo with large files (>100mb) into GitHub with the following command :

git lfs migrate import --include="*.gif"
git push origin master --force

Uploading LFS objects is successful. I get the following error:

remote: fatal: pack exceeds maximum allowed size (2.00 GiB) error: remote unpack failed: index-pack abnormal exit

I tried to do pushes in chunks with git push origin <commit>:refs/heads/master -f. But one of the files seems to be in the history which was deleted in a later commit.

remote: error: File /World/Maps/map_4.fbx is 337.34 MB; this exceeds GitHub's file size limit of 100.00 MB

This file is not getting tracked under: git lfs ls-files

I have already tried to manually add a line to the .gitattributes. Is there a way to successfully recognise this file or ignore it during push altogether?

torek
  • 448,244
  • 59
  • 642
  • 775
  • I don't use Git-LFS, but in general your initial "import" to LFS needs to list *all* the files you want LFS-ized. You listed `*.gif`, but `World/Maps/map_4.fbx` ends in `.fbx`, not `.gif`. Remember that on the Git side, *every* commit contains a *full snapshot* of *every* file, and the function of the LFS wrappers (which are not part of Git: LFS is a separate program that "wraps" Git) is to hide the large files from Git's "eyes" so that Git never stores them at all. – torek Oct 21 '22 at 23:59

2 Answers2

1

You can configure LFS like this:

git lfs track "*.fbx"

This will avoid the error that is related to your map_4.fbx file. Then try pushing to the remote repository again.

Ivan Yuzafatau
  • 449
  • 4
  • 11
0

I had to execute git lfs push --all origin master to add the additional files that were added later appended into .gitattributes. Partial push is now working.