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?
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.
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With