Git "fatal: repository not found" in CI
GitHub returned "Repository not found". For a private repo this is deliberately ambiguous - it means the same thing whether the repo does not exist or the credential simply cannot see it, so GitHub does not reveal which.
What this error means
A clone or fetch over HTTPS fails with remote: Repository not found. and fatal: repository not found. It is deterministic for a given URL and credential - every retry fails the same way.
remote: Repository not found.
fatal: repository not foundCommon causes
Wrong owner/repo in the URL
A typo in the org or repo name, or a repository that was renamed or deleted, makes the remote report the repo as not found.
The credential cannot see a private repo
For private repos GitHub returns "not found" rather than "forbidden". A token, deploy key, or App installation that was never granted this repo sees it as nonexistent.
A token scoped to the wrong account
A fine-grained PAT or App installation tied to a different org has no visibility here, so even an existing repo reads as not found.
How to fix it
Verify the exact URL and access
Probe the repo with the same credential the job uses; a successful ls-remote proves both the URL and access.
git remote -v
git ls-remote https://x-access-token:${GITHUB_TOKEN}@github.com/org/repo.gitGrant the credential access to the repo
- For a fine-grained PAT, add this repository to its repository-access list.
- For a GitHub App, confirm the installation covers this repo, not just the org default.
- For a deploy key, ensure it is added to this specific repository.
How to prevent it
- Pin the exact
org/repoURL in the workflow rather than relying on inherited config. - Scope fine-grained tokens and App installations to every repo a job clones.
- Use
actions/checkoutwith an explicittokenfor cross-repo clones.