Github error repository not found

If you're having trouble cloning a repository, check these common errors.

HTTPS cloning errors

There are a few common errors when using HTTPS with Git. These errors usually indicate you have an old version of Git, or you don’t have access to the repository.

Here’s an example of an HTTPS error you might receive:

> error: The requested URL returned error: 401 while accessing
> https://github.com/USER/REPO.git/info/refs?service=git-receive-pack
> fatal: HTTP request failed
> Error: The requested URL returned error: 403 while accessing
> https://github.com/USER/REPO.git/info/refs
> fatal: HTTP request failed
> Error: https://github.com/USER/REPO.git/info/refs not found: did you run git
> update-server-info on the server?

Check your Git version

There’s no minimum Git version necessary to interact with GitHub, but we’ve found version 1.7.10 to be a comfortable stable version that’s available on many platforms. You can always download the latest version on the Git website.

Ensure the remote is correct

The repository you’re trying to fetch must exist on GitHub.com, and the URL is case-sensitive.

You can find the URL of the local repository by opening the command line and
typing git remote -v:

$ git remote -v
# View existing remotes
> origin  https://github.com/ghost/reactivecocoa.git (fetch)
> origin  https://github.com/ghost/reactivecocoa.git (push)

$ git remote set-url origin https://github.com/ghost/ReactiveCocoa.git
# Change the 'origin' remote's URL

$ git remote -v
# Verify new remote URL
> origin  https://github.com/ghost/ReactiveCocoa.git (fetch)
> origin  https://github.com/ghost/ReactiveCocoa.git (push)

Alternatively, you can change the URL through our
GitHub Desktop application.

Provide an access token

To access GitHub, you must authenticate with a personal access token instead of your password. For more information, see «Creating a personal access token.»

If you are accessing an organization that uses SAML SSO and you are using a personal access token (classic), you must also authorize your personal access token to access the organization before you authenticate. For more information, see «About authentication with SAML single sign-on» and «Authorizing a personal access token for use with SAML single sign-on.»

Check your permissions

When prompted for a username and password, make sure you use an account that has access to the repository.

Tip: If you don’t want to enter your credentials every time you interact with the remote repository, you can turn on credential caching. If you are already using credential caching, please make sure that your computer has the correct credentials cached. Incorrect or out of date credentials will cause authentication to fail.

Use SSH instead

If you’ve previously set up SSH keys, you can use the SSH clone URL instead of HTTPS. For more information, see «About remote repositories.»

Error: Repository not found

If you see this error when cloning a repository, it means that the repository does not exist or you do not have permission to access it. There are a few solutions to this error, depending on the cause.

Check your spelling

Typos happen, and repository names are case-sensitive. If you try to clone git@github.com:user/repo.git, but the repository is really named User/Repo you will receive this error.

To avoid this error, when cloning, always copy and paste the clone URL from the repository’s page. For more information, see «Cloning a repository.»

To update the remote on an existing repository, see «Managing remote repositories».

Checking your permissions

If you are trying to clone a private repository but do not have permission to view the repository, you will receive this error.

Make sure that you have access to the repository in one of these ways:

  • The owner of the repository
  • A collaborator on the repository
  • A member of a team that has access to the repository (if the repository belongs to an organization)

Check your SSH access

In rare circumstances, you may not have the proper SSH access to a repository.

You should ensure that the SSH key you are using is attached to your personal account on GitHub. You can check this by typing
the following into the command line:

$ ssh -T git@github.com
> Hi USERNAME! You've successfully authenticated, but GitHub does not
> provide shell access.

If the repository belongs to an organization and you’re using an SSH key generated by an OAuth App, OAuth App access may have been restricted by an organization owner. For more information, see «About OAuth App access restrictions.»

For more information, see Adding a new SSH key to your GitHub account.

Check that the repository really exists

If all else fails, make sure that the repository really exists on GitHub.com!
If you’re trying to push to a repository that doesn’t exist, you’ll get this error.

Error: Remote HEAD refers to nonexistent ref, unable to checkout

This error occurs if the default branch of a repository has been deleted on GitHub.com.

Detecting this error is simple; Git will warn you when you try to clone the repository:

$ git clone https://github.com/USER/REPO.git
# Clone a repo
> Cloning into 'repo'...
> remote: Counting objects: 66179, done.
> remote: Compressing objects: 100% (15587/15587), done.
> remote: Total 66179 (delta 46985), reused 65596 (delta 46402)
> Receiving objects: 100% (66179/66179), 51.66 MiB | 667 KiB/s, done.
> Resolving deltas: 100% (46985/46985), done.
> warning: remote HEAD refers to nonexistent ref, unable to checkout.

To fix the error, you’ll need to be an administrator of the repository on GitHub.com.
You’ll want to change the default branch of the repository.

After that, you can get a list of all the available branches from the command line:

$ git branch -a
# Lists ALL the branches
>   remotes/origin/awesome
>   remotes/origin/more-work
>   remotes/origin/new-main

Then, you can just switch to your new branch:

$ git checkout new-main
# Create and checkout a tracking branch
> Branch new-main set up to track remote branch new-main from origin.
> Switched to a new branch 'new-main'

remote: Repository not found. can be a frustratingly misleading error message from github when trying to push to an HTTPS remote where you don’t have write permissions.

Check your write permissions on the repository!

Trying an SSH remote to the same repository shows a different response:

% git remote add ssh git@github.com:our-organisation/some-repository.git

% git fetch ssh
From github.com:our-organisation/some-repository
* [new branch]        MO_Adding_ECS_configs             -> ssh/MO_Adding_ECS_configs
* [new branch]        update_gems                       -> ssh/update_gems

% git push ssh     
ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

«The correct access rights?»

Well why didn’t you say so?

It’s worth noting at this point that while the SSH failure mode in this scenario
is slightly better, I use HTTPS remotes over SSH because
GitHub recommend HTTPS over SSH.

I understand that GitHub uses «Not Found» where it means «Forbidden» in some
circumstances to prevent inadvertently reveling the existence of a private
repository.

Requests that require authentication will return 404 Not Found, instead of
403 Forbidden, in some places. This is to prevent the accidental leakage of
private repositories to unauthorized users.

—GitHub

This is a fairly common practice around the web, indeed it is defined:

The 404 (Not Found) status code indicates that the origin server did not find
a current representation for the target resource or is not willing to
disclose that one exists.

—6.5.4. 404 Not Found, RFC 7231 HTTP/1.1 Semantics and Content (emphasis mine)

What makes no sense to me is when I am authenticated with GitHub using a
credential helper
and I have access to that repository (having successfully cloned and fetched
it) that GitHub would choose to hide its existence from me because of missing
write permissions.

Checking https://github.com/our-organisation/some-repository/ using a web
browser confirmed that I didn’t have write permissions to the repository. Our
team’s GitHub administrators were able to grant my team write access in a short
time and I was able to push the branch up.

Fix Git’s repository not found error

There’s nothing worse than joining a new development team and eagerly cloning the existing source code repo only to run head first into Git’s ‘fatal: repository not found’ error. For those who struggle with that problem, here are five potential fixes to the frustrating repository not found error message.

1. You did not authenticate

If you attempt to connect to a private GitHub or BitBucket repository and fail to authenticate, you will receive the repository not found error. To ensure you are indeed authenticating, connect to the repository and include your username and password in the Git URL:

git clone https://mcnz:[email protected]/cameronmcnz/private-github-repo.git


2. Your password has changed

Have you changed your password lately? If you connect from a Microsoft-based workstation, the Windows Credentials Manager may transparently submit an old password every time you clone, pull or fetch. Make sure your computer doesn’t cache any old, out of date passwords and cause your connection to be rejected.

3. You are not a collaborator

You may authenticate successfully against GitHub or GitLab, but if you haven’t been made a collaborator on the project, you won’t be able to see the repository and will again trigger the fatal: repository not found exception. If you’re not a collaborator on the project, contact one of the GitHub or BitBucket repository administrators and have them add you to that role.

4. Incorrect case or a word misspelled

If your source code management tool is hosted on a Linux distribution, the repository name may be case sensitive. Also watch out for creative repository spellings, such as a zero instead of the letter O, or a one in place of the letter L. If you can copy and paste the git clone command from provided documentation, do that.

5. The git repository has been deleted

If the repository was deleted or renamed, you’ll obviously hit a Git repository not found error when you attempt to clone or fetch from it. If all else fails, check with the team lead to ensure that the remote repository does indeed still exist. One way to fix that problem is to log into your DVCS tool as an administrator and actually create the Git repository.

If you have any more insights on why developers might run into Git’s ‘fatal: repository not found‘ error, please add your thoughts to the comments.

    Table of contents

  • GitHub Community
  • Git clone with https error — fatal: repository not found
  • Git Push ERROR: Repository not found
  • Git Clone — Repository not found
  • Fatal: repository ……. not found
  • remote: Repository not found (only on VSCode)
    #3109

I have a similar issue to Marvelous-Software. I created/initialized a local repo (“testrepo”) in Bash/Git, added a file and did an initial commit.

git remote set-url origin https://[email protected]/aceofwings/RotairERP.git
git remote set-url origin https://[email protected]/aceofwings/RotairERP.git

Github repository not found. fatal error remote repository not found, after supposedly swtiching accounts

Git is caching your login credentials. Use this to disable it: git config —system —unset credential.helper The git config user data is only used as an identity for commits, although …

git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/myaccount/myrepo.git
git push -u origin master
git config user.email "[email protected]"
git config user.password "secondaccountpassword"
git config --global user.email "[email protected]"
git config--global user.password "secondaccountpassword"
git config --system --unset credential.helper

Git clone with https error — fatal: repository not found

Here’s some things I have tried with no success: Verified the validity of the URL — Checked spelling and case. I am able to access the repo URL and download its contents through my …

$ git clone https://github.com/usernamex/privat-repo.git
cloning into 'privat-repo'...
Username for 'https://github.com':usernamex
Password for 'https://[email protected]':
remote: Repository not found.
fatal: repository 'https://github.com/usernamex/privat-repo.git/' not found
git clone https://username:[email protected]/usernamex/privat-repo.git
git clone https://github.com/USERNAME/REPO.git
git clone [email protected]:USERNAME/REPO.git
[remote "origin"]
    url = https://github.com/USERNAME/REPO.git
[remote "origin"]
    url = [email protected]:USERNAME/REPO.git
[remote "origin"]
        url = [email protected]:USERNAME/REPO.git
        fetch = +refs/heads/*:refs/remotes/origin/*
remote: Enumerating objects: 10642, done.
remote: Total 10642 (delta 0), reused 0 (delta 0), pack-reused 10642
Receiving objects: 100% (10642/10642), 510.06 MiB | 993.00 KiB/s, done.
Resolving deltas: 100% (7509/7509), done.
Updating files: 100% (2324/2324), done
remote: Repository not found.
fatal: repository 'https://github.com/workrepo/repository_I_needed.git/' not found

Git Push ERROR: Repository not found

I am having a very strange problem with git and github. When I try and push, I am getting: git push -u origin master ERROR: Repository not found. fatal: The remote end hung up unexpectedly I adde

git push -u origin master
ERROR: Repository not found.
fatal: The remote end hung up unexpectedly
git remote add origin [email protected]:account-name/repo-name.git
git remote rm origin
git remote add origin  https://USERNAME:[email protected]/username/reponame.git
git clone https://myusername:[email protected]/path_to/myRepo.git
ERROR: Repository not found.   
fatal: The remote end hung up unexpectedly
[remote "origin"]   
   url = [email protected]:alexagui/my_project.git  
   fetch = +refs/heads/*:refs/remotes/origin/*
git remote add origin [email protected]:alexagui/my_project.git  
git push -u origin master
ssh-add ~/.ssh/your_key
git remote rm origin
git remote add origin <remote url>
% git remote add ssh [email protected]:our-organisation/some-repository.git

% git fetch ssh
From github.com:our-organisation/some-repository
* [new branch]        MO_Adding_ECS_configs             -> ssh/MO_Adding_ECS_configs
* [new branch]        update_gems                       -> ssh/update_gems

% git push ssh     
ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
git push https://youruser:[email protected]/user/reponame.git
$ git remote rm origin
$ git remote add origin [email protected]:<USER>/<REPO>.git
$ ssh-keygen -t rsa -b 4096 -C "[email protected]"
$ eval "$(ssh-agent -s)"
$ ssh-add ~/.ssh/id_rsa_github
$ git remote -v
origin  https://github.com/private-repo.git (fetch)
origin  https://github.com/private-repo.git (push)
$ git remote rm origin
$ git remote add origin [email protected]:private-repo.git
$ git remote -v
origin  [email protected]:private-repo.git (fetch)
origin  [email protected]:private-repo.git (push)
git remote add origin https://github.com/YOUR_USER/your-repo.git
git push -u origin master
   git pull https://myusername:[email protected]/path_to/myRepo.git
git remote set-url origin https://<YOUR_USER_NAME_HERE>@github.com/<YOUR_USER_NAME_HERE>/<REPO>.git
git clone https://<YOUR_USER_NAME_HERE>@github.com/<YOUR_USER_NAME_HERE>/<REPO>.git    
ssh -T [email protected]
ERROR: Repository not found.
ssh -T [email protected]
Hi <github_account_name>! You've successfully authenticated, but GitHub does not provide shell access. I just had to give the access to fix the problem.
#check current github account
ssh -T [email protected]

#ensure the correct ssh key used with github
ssh-agent -s
ssh-add ~/.ssh/YOUR-GITHUB-KEY

#re-add the origin
git remote add origin [email protected]:YOUR-USER/YOUR-REPO.GIT
git push -u origin master
git remote rm origin
git remote add origin [email protected]:account-name/repo-name.git
git config --edit --system 
helper = manager 
git config --list --show-origin

Git Clone — Repository not found

In order to reset the credentials on Windows, open Control Panel (Win+r control), select User Accounts and Credentials Manager. Locate the git account in Windows …

git clone <url>
$ GIT_CURL_VERBOSE=1 git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY
$ echo <the key> | base64 --decode
https://github.com/user/repo2.git if you're using HTTPS
[email protected]:user/repo2.git if you're using SSH
git clone https://username:[email protected]/NAME/repo.git 
git credential-osxkeychain erase
host=github.com
protocol=https
git clone https://[email protected]/name/repo.git
git clone https://<USERNAME>:<PASSWORD>@github.com/<USERNAME>/<REPO_NAME>.git
git clone https://github.com/<USERNAME>/<REPO_NAME>.git
git clone https://<Token>@github.com/<USERNAME>/<REPO_NAME>.git
sudo su
git config --system --unset credential.helper
                             add your username
                                |-------|
$ git clone --recursive https://[email protected]/kmario23/repo-name.git
git remote rm origin
git remote add origin url
git config --global --unset credential.helper
git clone https://<repository>
git clone https://<USERNAME>@github.com/<REPONAME>/repo.git
export GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no -o User=git -i ~/.ssh/ssh_key_for_repo"

git clone [email protected]:user/repo.git

Fatal: repository ……. not found

Teams. Q&A for work. Connect and share knowledge within a single location that is structured and easy to search. Learn more

git remote add origin https://github.com/ni8mr/Local-Weather-App/tree/gh-pages
fatal: repository 'https://github.com/ni8mr/Local-Weather-App/tree/gh-pages.git/' not found

remote: Repository not found (only on VSCode)
#3109

Steps to Reproduce: Create a private repository on Github Clone it Commit any change and push it I always get this error message: remote: Repository not found. fatal

cd /path/to/your/repo
nano .git/config
[remote "origin"]
	url = https://github.com/username/repo.git
[remote "origin"]
	url = https://<username>:<personalToken>@github.com/username/repo.git

Next Lesson PHP Tutorial

When cloning a repository or pushing changes to it, you may encounter the Repository Not Found error. At first glance, the error message may give the impression that the repository might not exist or could’ve been deleted. But in most cases, this is not the cause.

Instead, the repository exists, but there’s usually an access-related issue or some problem with the remote origin which leads to this error. We’ve listed the causes in detail, as well as ways to fix this error in the sections below.

What’s Causing the Repository Not Found Error?

Here are the most common reasons for the Repository Not Found error:

  • The remote origin has been changed or set incorrectly.
  • You haven’t been added as a collaborator, or you don’t have write access.
  • Authentication issues due to the credential manager.

Before you start, please keep in mind that repo URLs are case-sensitive. As such, fixing this error could be as simple as adjusting the case usage.

Get Access to Repo

You should first ensure that this isn’t an access issue. Even if you’re added as a collaborator, you may not have write access which could be causing this error. This scenario is surprisingly common, so it’s best to check with the repo owner regarding this. Additionally, it’s also worth confirming that the repo hasn’t been renamed.

Check Remote Origin

If the remote origin has been changed or an incorrect value has been added, that can also cause this error. Here’s what you can do in such cases:

  1. Use cd to change directories to the local project directory.
  2. Enter git remote -v and check that the remote origin is accurate. Make sure there are no minor issues such as http:// in place of https://, or using the HTTPS format when you’re supposed to use SSH.
    git-remote-v
  3. If the remote origin needs to be modified, you can do so with the following command:
    git remote set-url origin <RepoURL>
  4. Alternatively, you can also remove the remote origin with the git remote rm origin command, then re-add it. When doing so, it’s worth checking that the error isn’t due to an authentication issue by adding your username to the url in the following fashion:
    git remote add origin https://username@github.com/username/reponame.git
    git-remote-rm-origin-add-origin
  5. This will prompt a reauthentication, and you may be asked to generate a personal access token.

Resolve Credential Issues

Outdated credentials in the system credential manager can also lead to this error, as it would cause the authentication to fail. Here’s how you can clear the git credentials on Windows:

  1. Press Win + R, type control, and press Enter.
  2. Go to User Accounts > Credential Manager > Windows Credentials.
    github-credentials-windows
  3. Expand and remove all the git credentials.

Here’s how you can do the same on Mac:

  1. Press Command + Shift + U and open the Keychain app.
  2. Select the git keychains from the list, right-click them, or choose File > Delete keychain > Delete references.
    delete-keychain

Additionally, if you use the git credential manager, you should remove and reinstall it. You can do so with the following commands:
git credential-manager uninstall
git credential-manager install

Git Request Limit

This fix is very niche, but it’s still worth mentioning. One user using the Git It Write plugin on WordPress found that this error occurred because his IP reached the API rate limit. Basically, because this plugin didn’t authenticate, the requests were limited to 60 per hour.

The Git It Write plugin has been updated to authenticate, so the issue shouldn’t be as common now. But there’s likely a limit to authenticated requests as well. If you suspect that this could be the issue in your case, you can test for it by switching to a different network or changing your IP some other way.

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Git ошибка error src refspec master does not match any
  • Git ошибка error failed to push some refs to
  • Git как исправить merge conflict
  • Git как изменить текст последнего коммита
  • Git как изменить сообщение последнего коммита

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии