Your Code. Your Rules.

Object Too Large

LFS: LFS object too large - one Git LFS file is over the instance limit (10 GiB by default).

LFS Object Too Large

Symptom

The push is refused before anything is sent:

LFS: LFS object too large
error: failed to push some refs to 'https://<INSTANCE>.git.eu/<USERNAME>/<REPO>.git'

Cause

One file stored in Git LFS is larger than the instance allows for a single LFS object. The default is 10 GiB per object; an instance may set another value. The whole push is refused, not only that file.

Diagnose

List the LFS files with their size, and look for the one over the limit:

git lfs ls-files --size

Fix

Option A - Split the file (recommended)

Cut the file into parts below the limit (for example with split -b 4G), commit the parts, and remove the big file from the commits that are not pushed yet. If it is in the last commit:

git rm --cached big.iso
git commit --amend

If it is in an older commit that is not pushed yet, edit that commit with git rebase -i origin/main. Only local commits change.

Option B - Keep the file out of the repository

Store it somewhere else (a download server, object storage) and commit a link or a checksum instead.

Option C - Ask your instance operator

The limit is set per instance. Ask the operator whether a higher value is possible.

Verify

git push

The push ends with Uploading LFS objects: 100% ... and no LFS object too large line.

Prevent

  • Check git lfs ls-files --size before pushing a very large file.
  • Keep build artifacts and disk images out of the repository.

Related