# Git LFS pointer file checked out instead of content in CI

> Fix the case where CI has the LFS pointer text (version https://git-lfs...) instead of the real file - the checkout did not run the smudge filter or LFS was not fetched.

Source: https://latchkey.dev/learn/command-reference/git-lfs-pointer-checked-out-instead-of-content-in-ci  
Updated: 2026-06-30

The working tree holds the LFS pointer text (a tiny file starting with "version https://git-lfs.github.com/spec/v1") rather than the real binary. The checkout skipped LFS, so nothing downloaded the content.

## 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 pointer file checked out instead of content in CI?

There are 2 common causes: the checkout did not enable lfs and lfs objects were never pulled. actions/checkout defaults to lfs: false, so it clones pointers without fetching objects.

### How do I fix Git LFS pointer file checked out instead of content in CI?

There are 2 fixes depending on which cause you have: enable lfs on the checkout and pull objects explicitly after a manual clone. Work through them in order, since the first is the most common.

### What does Git LFS pointer file checked out instead of content in CI actually mean?

A build reads a supposedly binary file and finds a few lines of text, or tools report an invalid image/archive.

### How do I stop Git LFS pointer file checked out instead of content in CI happening again?

Always set lfs: true when a job needs the tracked binaries. 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
