# Git LFS "batch request: missing protocol" in CI

> Fix Git LFS "batch request: missing protocol: ..." in CI - the configured LFS endpoint URL has no scheme (https://), so LFS cannot form a valid batch request.

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

LFS tried to build a batch request but the endpoint URL it derived has no protocol scheme. This happens when the remote is an SSH shorthand or a malformed `lfs.url`, so LFS cannot reach the object API.

## 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 "batch request: missing protocol" in CI?

There are 2 common causes: the remote uses scp-style ssh shorthand and a hand-set lfs.url without a scheme. A remote like git@github.com:acme/app.git is not a full URL, so the derived LFS endpoint lacks a scheme and LFS rejects it.

### How do I fix Git LFS "batch request: missing protocol" in CI?

There are 2 fixes depending on which cause you have: set an explicit https lfs endpoint and use an https remote in ci. Work through them in order, since the first is the most common.

### What does Git LFS "batch request: missing protocol" in CI actually mean?

checkout or git lfs pull fails with "batch request: missing protocol: \"git@github.com:acme/app.git\"" or a similar URL lacking https://.

### How do I stop Git LFS "batch request: missing protocol" in CI happening again?

Set lfs.url with an explicit https scheme when overriding it. 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
