Could not read from remote repository

前端 未结 21 3131
北荒
北荒 2020-12-15 02:30

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

21条回答
  •  时光说笑
    2020-12-15 03:14

    Assuming you have done the proper SSH keys configuration according to github's instructions it might be a problem of pull with https and later pushing with git+ssh

    to make it more clear

    if you have used https to pull

    git pull https://github.com/user/repo.git
    

    then you have changed remote URL

    git remote set-url origin git+ssh://github.com/user/repo.git
    

    and tried to push after some changes and commits

    git push origin master
    

    you might get this error it happened to me

    erase the local repository and re-clone using git+ssh

    git pull git+ssh://github.com/user/repo.git
    

    and now your push should work

提交回复
热议问题