)
前提操作
许久没用git了,我有预感,这会是一个**的错
我git clone https://github.com/username/responsitory.git
报错代码
Cloning into 'offer-Java'...
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
纠错过程
-
先看了有道以前的笔记(不知道写的啥,没啥用)
git pull
问题:could not read from remote repository …
原因:git remote -v 出来后都是ssh …
我 git set-url origin https://… 修改地址
再 git remote -v 还是 ssh
是因为设置了提交方式是ssh,而我的远程仓库没有没有添加公钥
解决:1.把提交方式改为https
这样每次提交都要输入密码
2.创建并把公钥加入远程仓库
git remote -v git查看远程仓库地址命令 -
使用命令把ssh更改为https失败
-
搜索“ssh更改为http失败”,无果
-
搜索“git clone 出错”,时间限制在一年内,成