天天看点

Git Pull Failed: Could not read from remote repository.

Git拉取项目时报错

Git Pull Failed: Could not read from remote repository.

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

$ git remote -v
origin  ssh://[email protected]:22222/YourProject.git (fetch)
origin  ssh://[email protected]:22222/YourProject.git (push)
           

你会发现跟你项目的远程地址不同,找到仓库地址http://开头的,如图,复制下来:

Git Pull Failed: Could not read from remote repository.

然后在终端中输入:

$ git remote set-url origin http://xxxx.git
           

重新拉取即可