Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git : fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists

Tags:

git

github

I am getting this error -

D:\Projects\wamp\www\REPO [master]> git pull origin master Warning: Permanently added 'github.com,192.30.252.128' (RSA) to the list of known hosts. 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 output of git remote -v

D:\Projects\wamp\www\REPO [master]> git remote -v origin  [email protected]:username/repo.git (fetch) origin  [email protected]:username/repo.git (push) 

Final message of ssh -Tv [email protected] command -

Hi [My Username]! You've successfully authenticated, but GitHub does not provide shell access. 

How can I solve it?

like image 752
Napster Avatar asked May 06 '15 05:05

Napster


People also ask

How do you fix fatal could not read from remote repository please make sure you have the correct access rights and the repository exists?

The Git “fatal: Could not read from remote repository” error occurs when there is an issue authenticating with a Git repository. This is common if you have incorrectly set up SSH authentication. To solve this error, make sure your SSH key is in your keychain and you connecting to a repository using the correct URL.

How do I fix git GitHub Permission denied Publickey fatal could not read from remote repository?

The “Permission denied (publickey). fatal: Could not read from remote repository” error is caused by an issue with the way in which you authenticate with a Git repository. To solve this error, make sure your key is being used on your Git account. If it is not, add your key to Git.

Does not appear to be a git repository fatal could not read from remote repository?

Note: The “fatal: 'origin' does not appear to be a git repository” error occurs when you try to push code to a remote Git repository without telling Git the exact location of the remote repository. To solve this error, use the git remote add command to add a remote to your project.


2 Answers

change your ssh url by an http url for your remote 'origin', use:

> git remote set-url origin https://github.com/<user_name>/<repo_name>.git 

It will ask for your GitHub password on the git push.

like image 156
Siyaram Malav Avatar answered Sep 20 '22 16:09

Siyaram Malav


I asked in the discussion:

does ssh -T [email protected] ouput the same username (in Hi [My Username]!) as in the one used for the ssh url of your repo ([email protected]:username/repo.git)?

Sorry It not showing same name

That means somehow the credentials have changed.

One solution would be to at least copy %HOME%\.ssh\id_rsa.pub in the SSH keys section of the right GitHub account

The OP adds:

I am working on private repo. So In [email protected]:username/repo.git,

I replied:

If you were able to clone/push to that repo whose username is not your own GitHub account, that must be because you had your previous public ssh key added as a contributor to that repo by the repo's owner.

What next is to ask that same repo owner to add your current public ssh key %HOME%\.ssh\id_rsa.pub to the repo contributor list.
So check with the owner that you (meaning your public ssh key) are declared as a contributor.

like image 31
VonC Avatar answered Sep 18 '22 16:09

VonC