GitHub Actions: fatal: couldn't find remote ref refs/heads/feature — The process '/usr/bin/git' failed with exit code 1 (actions/checkout)
actions/checkout could not fetch the branch, tag or SHA it was asked for — it was deleted, never pushed, or is not reachable with the default shallow fetch.
fatal: couldn't find remote refcouldn't find remote ref refs/headsThe process '/usr/bin/git' failed with exit code 1checkout couldn't find remote ref Meaning
Checkout fetches a single commit (fetch-depth: 1) of the triggering ref. Asking for another ref, a tag, or history (for git describe, changelogs, diffs) fails unless you widen the fetch. Deleted branches and PRs from forks also yield this error.
Common causes
- Branch deleted or renamed before the job ran
ref:input misspelled- Tags or full history needed but fetch-depth is 1
- Fork PR ref not available with the given repository input
- Private repository requires a token with access
⚡ Quick fix
- Check that
ref:exists on the remote - Use
fetch-depth: 0(andfetch-tags: true) when you need history or tags - Pass
repository:andtoken:for other repositories
Detailed fix by platform
GitHub Actions
- Verify the ref:
git ls-remote origin refs/heads/feature
Code examples
Full history
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: trueHow to diagnose
- Ref — Does it exist remotely?
- Depth — History needed?
- Repo — Same repository or another?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- API rate limit exceeded GitHub Actions: HttpError: API rate limit exceeded for installation ID 123456 / secondary rate limit
- Cache not found / Unable to reserve cache GitHub Actions: Cache not found for input keys: npm-Linux-abc123 / Failed to save: Unable to reserve cache with key, another job may be creating this cache
- Credentials could not be loaded GitHub Actions: Error: Credentials could not be loaded, please check your action inputs: Could not load credentials from any providers
Most viewed in CI/CD
- This job is stuck because you don't have any active runners GitLab CI: This job is stuck because you don't have any active runners online or available with any of these tags assigned to them
- Waiting for next available executor Jenkins: Still waiting to schedule task — Waiting for next available executor / 'agent1' is offline
- ComparisonError: manifest generation failed Argo CD: ComparisonError: rpc error: code = Unknown desc = Manifest generation error (cached): kustomize build failed
Other ways to find it
Where this error sits
Origin: Build & delivery. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 25 Oct 2026