Could not read from remote repository

前端 未结 21 3135
北荒
北荒 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:18

    Try these 3 Simple Steps:

    It's pretty straight forward. See the 3 step summary of the links below.

    1. Check for the existence of SSH keys. If one exists, then great: you can use it. If not, then you will have to create one.
    2. You will need to add the ssh key to the ssh-agent. If the agent is snoozing on the job, then you will need to wake the agent by writing this to your console/terminal: eval $(ssh-agent -s). Then you can simply add the key,
    3. Try pushing your repository. Hopefully it should work.
    0 讨论(0)
  • 2020-12-15 03:18

    if you want to push/pull any repository from local to remote(git hub)
    first checkout

    $ git push https://<git-hub url>
    

    working fine with username and passwd credential

    $ git push git@<git-hub url>
    

    fail
    Could not read remote repository. Please make sure you have the correct access rights and the repository exists.

    this means you need to add id_rsa.pub to authorized_keys

    goto 
    $ cd /home/admin/.ssh
    $ls
    $vi authorized_keys
    add id_rsa keys(n no of keys you can add)
    ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEA0KJDLOiiXj9XdMxiCT9KvaKfuxFQi+CIiklaN5hHsNgYOu7TijqyONEu5fONLoAo/cshLa+KuargyTrtizwcP4TPcTXZhhJrM0GUDJragw7SMVIs/5xJBGAyHKJ1YUMGO7+nJTmsCLx6PFOlQYveuriiVVCCZerGCLH+UtSXK3z+l7hx9NiDg3/ylOLc3f3SLxrJKn0gMTgK7BHJFXo4PguuPjWZLVdUDX+XKiqtT2n4IsYs6N9qVFG3zUgNlEjZM47NK/ytAC0max98pK+QNzsuaQOo/IShJ1TOw5wwScflPArVJ2AyROqAe7cfQg7q12I9olASFd3U5NazfZCTYAvWA1kz9UZEWLJ1Br1XOkPqOleMM8KCp/PXzz8H0kISkMIji0/QuiZOPEBsKlszXjlALcXR8Mg1uiZVWy48i9JheyXyj1ToCj6cPScpgFHp3DAGSlKKbE1EFaVfeeyGAnHESlnDDg3Gq5xSsB9Okqm3V5t8GpFaJbV68BxQ4BK6HJ21A3CinV4LdV3hR/OBUbDG2EcI+ZKRDjlpJuu4YU= stace@pretend-machine
    ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAywWhrwq4FjHt+UuwZcZePxtjtZOENFpOjufycaYso2nTlzNwnAQEQRfbqsUxKVtOtGxgApIkUvjRIjNBdJE6iOzvBXZhhJrM0GUDJragw7SMVIs/5xJBGAyHKJ1YUMGO7+nJTmsCLx6PFOlQYveuriiVVCCZerGCLH+UtSXK3z+l7hx9NiDg3/ylOLc3f3SLxrJKn0gMTgK7BHJFXo4PguuPjWZLVdUDX+XKiqtT2n4IsYs6N9qVFG3zUgNlEjZM47NK/ytAC0max98pK+QNzsuaQOo/IShJ1TOw5wwScflPArVJ2AyROqAe7cfQg7q12I9olASFd3U5NazfZCTYAvWA1kz9UZEWLJ1Br1XOkPqOleMM8KCp/PXzz8H0kISkMIji0/QuiZOPEBsKlszXjlALcXR8Mg1uiZVWy48i9JheyXyj1ToCj6cPScpgFHp3DAGSlKKbE1EFaVfeeyGAnHESuXC9wkSeFZCEyMJ+RgJxMkBXNZmyycbwsSqAeGJpMEUDlwzu2GD0obBz0HXqg9J1Xallop5AVDKfeszZcc= stace@another-machine
    
    :wq!
    

    goto github-->settings--->ssh---->add new key---->id_rsa.pub

    $git push git@<git-hub url>
    
    0 讨论(0)
  • 2020-12-15 03:19

    I had same issue on my private Ubuntu server using ssh.

    My workaround solution was:

    open shell on my private server

    git init --bare /path/<myapp>.git
    

    and then, from my developer laptop

    git push <remote_repo> <local branch>
    

    has finally worked well.

    PS:

    I've never tried, but remote repo with https seems working better than ssh.

    I hope this help.

    0 讨论(0)
提交回复
热议问题