# Git LFS "unable to lock ... locking not supported" in CI

> Fix Git LFS "unable to lock" / "locking not supported" in CI - a lock command or lock verification ran against a remote that does not implement the LFS locking API.

Source: https://latchkey.dev/learn/command-reference/git-lfs-unable-to-lock-not-supported-in-ci  
Updated: 2026-06-30

A `git lfs lock` call or a push with lock verification hit a remote that does not support the LFS locking API. The operation cannot acquire or verify the lock, so it errors.

## 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 "unable to lock ... locking not supported" in CI?

There are 2 common causes: the remote lacks lfs locking support and ci runs a locking step that is not needed. Not every LFS server implements locking.

### How do I fix Git LFS "unable to lock ... locking not supported" in CI?

There are 2 fixes depending on which cause you have: disable lock verification and drop lock steps and only lock against a supporting remote. Work through them in order, since the first is the most common.

### What does Git LFS "unable to lock ... locking not supported" in CI actually mean?

git lfs lock or a push fails with "unable to lock" or "Remote does not support the LFS locking API" in a CI job that touches LFS-tracked files.

### How do I stop Git LFS "unable to lock ... locking not supported" in CI happening again?

Set lfs.locksverify false on remotes without locking support. 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
