Home › Git

remote: Repository not found. fatal: repository not found — how to fix

remote: Repository not found.
fatal: repository 'https://github.com/user/repo.git/' not found

Quick fix: Check the URL with git remote -v. If it's private, make sure you're authenticated as an account with access: clear the cached credential (Windows Credential Manager / macOS Keychain) or switch to SSH: git remote set-url origin git@github.com:user/repo.git.

What it means

The server said the repository doesn't exist for you. For private repositories, GitHub, GitLab and Bitbucket return "not found" when you lack access so they don't reveal that it exists.

Cause 1: wrong URL

git remote -v

Look for typos, wrong owner/organization, a renamed or transferred repo, or a missing .git. Fix it:

git remote set-url origin https://github.com/owner/repo.git

Cause 2: cached credentials for a different account

You have two GitHub accounts (work/personal), and Git keeps sending the wrong one.

bash printf "protocol=https\nhost=github.com\n" | git credential-osxkeychain erase

Next push will prompt again. Use a personal access token as the password.

You can also pin the user in the URL: https://yourname@github.com/owner/repo.git.

Cause 3: token without the right access

Cause 4: you haven't been added yet

Ask the owner to add you as a collaborator and accept the email invitation; access doesn't start until you accept.

Cause 5: the repo doesn't exist yet

Create it on GitHub first (or with gh repo create), then push.

Last updated 2026-10-29.