Skip to content
Latchkey

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.

git clone output
remote: Repository not found.
fatal: repository not found

Common 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.

Terminal
git remote -v
git ls-remote https://x-access-token:${GITHUB_TOKEN}@github.com/org/repo.git

Grant the credential access to the repo

  1. For a fine-grained PAT, add this repository to its repository-access list.
  2. For a GitHub App, confirm the installation covers this repo, not just the org default.
  3. For a deploy key, ensure it is added to this specific repository.

How to prevent it

  • Pin the exact org/repo URL in the workflow rather than relying on inherited config.
  • Scope fine-grained tokens and App installations to every repo a job clones.
  • Use actions/checkout with an explicit token for cross-repo clones.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →