THE GITHTML FIELD GUIDE
Diagnose GitHub “Repository not found” in the terminal
GitHub’s “Repository not found” response can mean the repository URL is wrong or the authenticated identity cannot access it. Verify the owner and repository, confirm the account used by the terminal, and check access requirements. A repository opening in your browser does not prove the terminal is using that same account or credential.
Separate existence from authorization
Private repositories can appear unavailable to identities without access. The message alone therefore cannot tell you whether the repository was deleted, renamed, transferred, or merely hidden from your credential. Verify the destination through an authorized browser session and copy the repository’s actual clone URL rather than a file-page or pull-request URL.
If the repository belongs to an organization, check whether your invitation is accepted and whether organization policy requires approval or authorization for the credential type. Do not ask a teammate to share their token. Access should be granted to your account through the owner’s intended mechanism, with the minimum permissions needed for your task.
Identify the terminal’s authentication path
Inspect the remote protocol. HTTPS commonly uses a credential helper or supported sign-in tool; SSH uses a selected key and account association. Diagnose the relevant mechanism instead of changing both simultaneously. The read-only ls-remote command can test the configured repository without modifying your working branch.
- For HTTPS, inspect which account your credential manager or approved CLI is using, and refresh only the relevant stored credential if it is stale.
- For SSH, test the connection to the correct host and verify the reported account. Successful SSH authentication still needs repository-specific authorization.
git remote -v
git remote get-url origin
git ls-remote originRetry after one verified correction
Correct a misspelled URL, accept the legitimate invitation, authorize the appropriate credential, or obtain owner approval as the evidence requires. Then repeat the read-only check. If access still fails, provide the repository owner with the sanitized URL, account identity, protocol, and error timing rather than private credentials.
Do not recreate the repository or force-push to a similarly named destination as a workaround. If the repository moved, confirm the canonical new location with its owner. Once reading works, treat writing as a separate permission check: being able to fetch does not imply that direct pushes to a protected branch are allowed. Preserve local work while the access issue is resolved.
- If a teammate recently transferred the repository, ask for its canonical owner and name and compare those with the terminal URL. Browser redirects can conceal an old address. Confirm your account’s access at the new location before deciding that an authentication refresh alone will resolve the error.
- When a fine-grained credential can read another private repository but not this one, check its selected repository list and resource owner. Successful access elsewhere only proves that credential works within its existing grant. Request the missing authorized selection rather than broadening permissions unrelated to this repository.
Sources and further reading
AI-assisted writing with source-linked guidance and illustrative examples. Read our editorial approach or report a correction.