github异常问题总结

问题1:

git@gitlab.gz.cvte.cn: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

解决方法:
这个错误表示 GitLab 服务器拒绝了你的 SSH 连接,原因是你没有提供有效的公钥。你可以按照以下步骤来解决这个问题:

1. 在你的本地机器上生成一个新的 SSH 密钥。你可以使用 ssh-keygen 命令来生成一个新的 SSH 密钥。例如:

ssh-keygen -t rsa -b 4096 -C
这个命令将生成一个新的 RSA 密钥,密钥长度为 4096 位。请将 "your_email@example.com" 替换为你的电子邮件地址。

2. 将你的公钥添加到 GitLab。

在这里插入图片描述

问题2
git clone的时候出现timeout问题:

fatal: unable to access 'https://github.com/XXX.git/': Failed to connect to github.com port 443: Connection timed out

解决方法:

取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy

问题3
git clone https://github.com/xxx.git时出现的错误:

remote: Enumerating objects: 2007, done.
error: RPC failed; curl 56 GnuTLS recv error (-54): Error in the pull function.
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

解决方法:
这个错误可能是由于 Git 在克隆大的仓库时遇到了网络问题。你可以尝试以下方法来解决这个问题:

增加 Git 的 HTTP/HTTPS 缓冲区大小。你可以使用以下命令来增加缓冲区大小:
git config --global http.postBuffer 524288000

这个命令将缓冲区大小设置为 500 MB。这可以帮助 Git 处理大的文件和大的仓库。

问题4
git clone https://github.com/xxx.git时出现的错误:

remote: Enumerating objects: 399, done.
remote: Counting objects: 100% (146/146), done.
remote: Compressing objects: 100% (96/96), done.
fatal: the remote end hung up unexpectedlyiB | 104.00 KiB/s 
fatal: early EOF
fatal: index-pack failed

解决方案:
在终端输入以下几行命令:

export GIT_TRACE_PACKET=1
export GIT_TRACE=1
export GIT_CURL_VERBOSE=1

再执行git clone就行了

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值