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.
- Tutorial on why and how to use git-lfs
- How to migrate existing large files to git-lfs using git-lfs-migrate
❯ 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
- 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-lfsbased on your OS distribution.
- Large files have been already commited and now no matter what you do
git pushrejects with above error? If this is the case, please use the
git lfs migratecommand 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