Git : fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists
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.