Push Too Large (413)
error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413 - the push is over the instance limit (2 GiB by default).
Push Too Large (HTTP 413)
Symptom
error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413
send-pack: unexpected disconnect while reading sideband packet
fatal: the remote end hung up unexpectedly
Everything up-to-date
Despite the last line, nothing was pushed.
Cause
The data of one push is larger than the instance allows. The default is 2 GiB per push; an instance may set another value. This limit does not apply to Git LFS objects, which travel separately.
- Large binary files were committed without Git LFS.
- The first push of a repository with a long or heavy history sends everything at once.
Diagnose
1. Show the size of the local repository (size-pack):
git count-objects -vH
2. Find the file types that weigh most in the commits not pushed yet:
git lfs migrate info
Fix
Option A - Move the large files to Git LFS (recommended)
Convert them in the commits that are not pushed yet (by default the command touches only those, on the current branch), then push:
git lfs migrate import --include="*.iso"
git push
This rewrites local commits only. Commits already on the server stay as they are.
Option B - Push the history in parts
For a heavy history, push an older commit first, then the rest:
git push origin HEAD~500:refs/heads/main
git push origin main
Lower the number until each push is below the limit.
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 the branch update line (main -> main), with no HTTP 413.
Prevent
- Track large file types with Git LFS before committing them (
git lfs track "*.iso").