How to upload large files (size) to your submission

We limit the individual file size to 50M in Gitlab repositories. In case, you are trying to upload a larger file like trained models, etc the git push will fail with following error:

remote: fatal: pack exceeds maximum allowed size
error: remote unpack failed: index-pack abnormal exit

If this is the case, you will have to use git-lfs for larger files. We recommend using git-lfs-migrate to migrate existing larger files into git-lfs.

Links:

  1. Tutorial on why and how to use git-lfs
  2. How to migrate existing large files to git-lfs using git-lfs-migrate

Quick Commands:

❯ git lfs install
Updated git hooks.
Git LFS initialized.
❯ git lfs track "*.mymodel"
Tracking "*.mymodel"
❯ git add .gitattributes
❯ git add some.mymodel
❯ git commit [...]
❯ git push origin master

Other notes:

  • In case you are a windows user and want to avoid using terminal, you can use “git for windows” application instead. (contributed by @HarryWalters)
  • In case you are getting git: 'lfs' is not a git command. See 'git --help'. error, it is possible your git version is old which don’t come with lfs bundled. Install it using apt-get install git-lfs/brew install git-lfs based on your OS distribution.
  • Large files have been already commited and now no matter what you do git push rejects with above error? If this is the case, please use the git lfs migrate command which ammend your git tree and fixes this problem. You may need to force push once this is done. https://github.com/git-lfs/git-lfs/wiki/Tutorial#migrating-existing-repository-data-to-lfs
2 Likes