Git LFS "Authentication required" credentials error in CI
By Kaveh Alemi·Latchkey
The LFS server challenged the request for credentials and none were provided. On a CI runner there is no interactive prompt, so the fetch fails immediately with "Authentication required".
What this error means
A fetch prints "Authentication required: Authentication required for https://github.com/acme/app.git/info/lfs" and the checkout aborts.
git-lfs
batch response: Authentication required: Authentication required for
https://github.com/acme/app.git/info/lfs/objects/batch
error: failed to fetch some objects
Common causes
No token was passed to the checkout
A bare git clone in a step without the persisted credentials from actions/checkout sends anonymous LFS requests that are challenged.
A private repo cloned without credentials
For a private repo, the LFS endpoint always requires auth; without a token the batch request is rejected before any object transfers.
How to fix it
Let checkout persist credentials and enable LFS
Use actions/checkout with lfs: true; it configures the token for LFS.
For manual clones, supply the token in the URL or via the git credential helper.
Re-run so the batch request carries credentials.
.github/workflows/ci.yml
- uses:actions/checkout@v4with:lfs:true
Provide credentials for a manual clone
When cloning outside the checkout action, embed a token so LFS can authenticate.
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@v4with:fetch-depth:0 # history, tags, and git describe all need this- run:|git rev-parse --is-shallow-repository # expect falsegit rev-parse --abbrev-ref HEAD # prints HEAD when detached
How to prevent it
Prefer actions/checkout with lfs: true so credentials persist.
Never rely on interactive auth on a CI runner.
Store manual-clone tokens in secrets, not in logs.
Frequently asked questions
What causes Git LFS "Authentication required" credentials error in CI?
There are 2 common causes: no token was passed to the checkout and a private repo cloned without credentials. A bare git clone in a step without the persisted credentials from actions/checkout sends anonymous LFS requests that are challenged.
How do I fix Git LFS "Authentication required" credentials error in CI?
There are 2 fixes depending on which cause you have: let checkout persist credentials and enable lfs and provide credentials for a manual clone. Work through them in order, since the first is the most common.
What does Git LFS "Authentication required" credentials error in CI actually mean?
A fetch prints "Authentication required: Authentication required for https://github.com/acme/app.git/info/lfs" and the checkout aborts.
How do I stop Git LFS "Authentication required" credentials error in CI happening again?
Prefer actions/checkout with lfs: true so credentials persist. The prevention section lists 3 changes that keep it from recurring.