I have received the following error multiple times:
Could not read remote repository. Please make sure you have the correct access rights and the repo
ssh-add -A resolved my issue in MacOS Sierra 10.12.6.
I had no problem both for public and private repo before.
Today I tried to clone or git pull for private repo, but it hit the above issues.
After search around, this is the perfect solution for me.
I also had the exact same error and for some reason restarting my pc solved the error. Maybe it works for somone else too :P
If it's a public repo, just clone using https
. No need to use passwords or setup SSH keys.
I had a similar issue, Until I realized, I was running my machine through a proxy address for my internet connection and it happens to close the host connection. This could be one of the few reasons too.
I had the exact same issue with a private repo. Cloning through the same error both through https and ssh
Then I made a commit through github (simply updated the README.md
with an empty line)
Surprisingly enough, this resolved the issue. It would be nice to know why though!
I had the same problem - it was caused by me using the SSH key instead of the HTTPS URL. I created my repository by importing a project via Intellij and it must have pushed via HTTPS.