Git Clone失败-致命:远端意外挂断.致命:早期EOF致命:索引包失败 [英] Git Clone Fails - fatal: The remote end hung up unexpectedly. fatal: early EOF fatal: index-pack failed
问题描述
我的计算机具有正确的配置SSH,尝试克隆存储库时出现此错误:
My computer has proper configuration SSH, I got this error when trying to clone the repository:
我运行此命令来克隆存储库
I run this command to clone the repository
git clone ssh://git-codecommit.us-west-2.amazonaws.com/v1/repos/NewsFeed-library library1
这给我一个错误:
克隆到"library1" ...
Cloning into 'library1'...
远程:计数对象:510,完成.
remote: Counting objects: 510, done.
与git-codecommit.us-west-2.amazonaws.com的连接被远程关闭
Connection to git-codecommit.us-west-2.amazonaws.com closed by remote
主机.致命:远端挂断了意外致命:早期EOF
host. fatal: The remote end hung up unexpectedly fatal: early EOF
致命:索引包失败
如何解决此错误以及为什么会出现此错误?
我已经尝试过,但是没有成功:
I have already tried it but did not succeed:
#Windows
set GIT_TRACE_PACKET=1
set GIT_TRACE=1
set GIT_CURL_VERBOSE=1
和
git config --global ssh.postBuffer 524288000
推荐答案
如果您可以选择在http上进行克隆,请在gitbash中运行以下任何命令,然后尝试克隆存储库,便可以使用.
If you have an alternative option to clone on http, run any of the below commands in gitbash and try to clone the repository, it should work.
-
git config --global http.postBuffer 524288000
-
git config --global http.postBuffer 1048576000
git config --global http.postBuffer 524288000
git config --global http.postBuffer 1048576000
而且,如果您没有 http 选项,并且想继续使用 ssh . 您可以在客户端或服务器上配置SSH keepAlive.
And, if you don't have the option of http and want to proceed with ssh. You can configure SSH keepAlive either on the client or server.
在服务器上配置
编辑
~/.ssh/config
ServerAliveInterval 60
ServerAliveCountMax 5
在客户端上配置 在/etc/ssh/sshd_config
ClientAliveInterval 60
ClientAliveCountMax 5
例如
echo 'ClientAliveInterval 60' | sudo tee --append /etc/ssh/sshd_config
git config --global ssh.postBuffer 1048576000
git config --global ssh.postBuffer 1048576000
尝试增加缓冲区,我在存储库中遇到了同样的问题.
Try increasing the buffer, i face the same probelm in my repository.
这篇关于Git Clone失败-致命:远端意外挂断.致命:早期EOF致命:索引包失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!