git报错合集
1.git clone时出现报错:
fatal: unable to connect to github.com: github.com[0: 20.205.243.166]: errno=Connection timed out
解决方法:
git config --global url."https://".insteadOf git://
2.git clone时出现报错:
fatal: unable to access 'xx.git': Encountered end of file
解决方法:
fatal: Authentication failed for xxx
3.git pull origin main时出现报错:
fatal: unable to access 'xx': Failed connect to github.com:443; Connection timed out
4.git clone时出现报错:
`fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists. 解决方法: 问题1:没有添加ssh 解决方法: 在终端输入 ssh-keygen -t rsa -C "username" (注:username 为你 git 上的用户名) 问题2:远程仓库不匹配 解决方法:删除仓库再重新添加 git remote rm origin //删除
git remote add origin git@xxx:xx/xxx.git //添加新的地址`
问题3:Permission denied (publickey).
1.远程主机禁用了ssh密码登录权限
2.本地访问远程主机的公钥没有添加或者被取消(无法认证)
解决方法:1.允许ssh登录权限
登录目标机器,打开/etc/ssh/sshd_config ,修改PasswordAuthentication no为:
PasswordAuthentication yes。
2.在github ssh_key中添加.ssh中id_rsa.pub的内容。

浙公网安备 33010602011771号