0
点赞
收藏
分享

微信扫一扫

git clone xxxxx 报错汇总及问题解决

亿奇学 2022-01-13 阅读 230
gitgithubssh

问题1:fatal: Could not read from remote repository.

在服务器上运行 git clone xxxxx 下载程序时会报如下错误:

Warning: Permanently added ‘github.com,xx.xxx.xxx.xx’ (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

请添加图片描述

原因分析:

在GitHub中上传代码需要设置公钥,如果设置则可能是当前操作用户与GitHub中存储公钥不匹配。

解决方案:

  1. 首先查看自己是否有公钥。运行指令

如果有公钥则会看到一大段字符串:ssh-rsa…,这就是所谓的publickey;但是如果提示报错的话则说明没有公钥,此时你应当自己创建一个公钥,输入

然后一直回车就行,最后会生成一个矩形框框一样的东西,就说明公钥已经生成。

请添加图片描述

此时再运行指令

就会看到那一大段字符串,就是publickey。

  1. 复制公钥。从ssh-rea开始一直到末尾xxx@xxxxxx前,选中,右键copy复制。

请添加图片描述

  1. 登录GitHub,点击右上角头像 –> settings –> SSH and GPG keys –> new SSH key –> title自己取名,key中粘贴publickey –> Add SSH key –> 成功.

请添加图片描述

  1. 再次运行代码 git clone xxxxxxxxxxxx. 成功运行。

请添加图片描述

参考链接:

  • github连接远程仓库时出现Warning: Permanently added the RSA host key for IP address
  • github配置公钥方法

问题2:ERROR: Command errored out with exit status 128: git clone -q

在服务器上运行 git clone https://xxxxx 下载程序时会报如下错误:

fatal: unable to access 'https://github.com/cocodataset/cocoapi.git/': GnuTLS recv error (-9): A TLS packet with unexpected length was received. WARNING: Discarding git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI. Command errored out with exit status 128: git clone -q https://github.com/cocodataset/cocoapi.git /tmp/pip-req-build-o_aocosg Check the logs for full command output. ERROR: Command errored out with exit status 128: git clone -q https://github.com/cocodataset/cocoapi.git /tmp/pip-req-build-o_aocosg Check the logs for full command output.

请添加图片描述

解决方案:

将命令行里的http改为git后重新执行。

请添加图片描述

参考链接:

  • git clone 出现fatal: unable to access ‘https://github类错误解决方法

问题3:error: RPC failed; result=35, HTTP code = 0

error: RPC failed; result=35, HTTP code = 0
fatal: The remote end hung up unexpectedly

在这里插入图片描述

解决方案:

将 git clone https://github.com/***** 改为 git clone git://www.github.com/***** 。

在这里插入图片描述

参考链接:

  • 解决git clone报错error: RPC failed; result=35, HTTP code = 0
举报

相关推荐

0 条评论