gitgithub

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


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  git@github.com:username/repo.git (fetch)
origin  git@github.com:username/repo.git (push)

Final message of ssh -Tv git@github.com command -

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

How can I solve it?


Solution

  • I asked in the discussion:

    does ssh -T git@github.com ouput the same username (in Hi [My Username]!) as in the one used for the ssh url of your repo (git@github.com: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 git@github.com: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.