git pull时报错fatal: Could not read from remote repository.

    xiaoxiao2021-03-25  165

    git pull 时 报错如下信息: ssh: Could not resolve hostname https: nodename nor servname provided, or not known fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

    这是由于你的git地址采用了ssh方式,切换为https方式即可,也可能是你的仓库地址不对,可以使用如下命令先查看一下:

    $ git remote -v

    origin    https:YourUserName/YatouTest00123.git (fetch) origin    https:YourUserName/YatouTest00123.git (push)

    你会发现跟你的github地址不一样,登上你的github,找到仓库地址,如图,复制下来:

    然后在终端中输入:

    $ git remote set-url origin https://github.com/YourUserName/YatouTest00123.git 

    注:origin后面换成刚刚让你复制的仓库地址。

    然后重新 执行 git pull  即可pull成功。

    转载请注明原文地址: https://ju.6miu.com/read-4600.html

    最新回复(0)