栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

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

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

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

问题1:

在服务器上运行 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. 首先查看自己是否有公钥。运行指令

cat ~/.ssh/id_rsa.pub

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

ssh-keygen

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

此时再运行指令

cat ~/.ssh/id_rsa.pub

就会看到那一大段字符串,就是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:

在服务器上运行 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类错误解决方法

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/291707.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号