# Git LFS "git lfs push ... 413 Request Entity Too Large" in CI

> Fix Git LFS push failing with HTTP 413 in CI - the LFS object upload exceeded a size limit imposed by the server or an intervening proxy.

Source: https://latchkey.dev/learn/command-reference/git-lfs-push-413-too-large-in-ci  
Updated: 2026-06-30

The LFS object upload was rejected with 413 Request Entity Too Large. Either the LFS server enforces a per-object cap or a proxy in front of it limits request body size below the object.

## Using this in CI

CI checkouts are shallow and detached by default, which changes the answer this command gives you. Commands that read history, branch names, or tags need the checkout configured for it.

```.github/workflows/ci.yml
- uses: actions/checkout@v4
  with:
    fetch-depth: 0   # history, tags, and git describe all need this

- run: |
    git rev-parse --is-shallow-repository   # expect false
    git rev-parse --abbrev-ref HEAD          # prints HEAD when detached
```

> `git rev-parse --abbrev-ref HEAD` returns the literal string `HEAD` on a detached checkout rather than a branch name. On GitHub Actions read `github.ref_name` instead; the git command cannot know what it was checked out for.

## FAQ

### What causes Git LFS "git lfs push ... 413 request entity too Large" in CI?

There are 2 common causes: a reverse proxy caps request body size and the lfs server enforces a per-object limit. A self-hosted LFS server behind nginx or similar may set a low client_max_body_size, rejecting large object uploads with 413.

### How do I fix Git LFS "git lfs push ... 413 request entity too Large" in CI?

There are 2 fixes depending on which cause you have: raise the proxy body-size limit and split or shrink oversized objects. Work through them in order, since the first is the most common.

### What does Git LFS "git lfs push ... 413 request entity too Large" in CI actually mean?

git lfs push fails with "LFS: [413] Request Entity Too Large" for a large object while smaller objects upload fine.

### How do I stop Git LFS "git lfs push ... 413 request entity too Large" in CI happening again?

Set proxy body-size limits above your largest LFS object. The prevention section lists 3 changes that keep it from recurring.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
