# GitHub Actions checkout missing "lfs: true" in CI

> Fix builds that get LFS pointers because actions/checkout ran without lfs: true in CI - the default checkout does not fetch LFS objects.

Source: https://latchkey.dev/learn/command-reference/git-lfs-checkout-lfs-true-missing-in-ci  
Updated: 2026-06-30

actions/checkout defaults to `lfs: false`, so it clones the repo with LFS pointers but does not download the objects. Any step that reads a tracked binary then sees pointer text instead of 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 GitHub Actions checkout missing "lfs: true" in CI?

There are 2 common causes: the checkout step omits lfs: true and a cached checkout config without lfs. Without the input, actions/checkout skips the LFS fetch entirely, leaving pointers in the working tree.

### How do I fix GitHub Actions checkout missing "lfs: true" in CI?

There are 2 fixes depending on which cause you have: add lfs: true to the checkout and pull lfs after checkout if you cannot change the step. Work through them in order, since the first is the most common.

### What does GitHub Actions checkout missing "lfs: true" in CI actually mean?

A workflow builds cleanly locally but fails in CI when a binary asset is unreadable, and the file contents show an LFS pointer rather than the real data.

### How do I stop GitHub Actions checkout missing "lfs: true" in CI happening again?

Standardize lfs: true in workflow templates that use LFS. 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
