Git Clone Fails - fatal: The remote end hung up unexpectedly. fatal: early EOF fatal: index-pack failed

ⅰ亾dé卋堺 提交于 2020-06-07 06:02:55

问题


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

It's giving me an error:

Cloning into 'library1'...

remote: Counting objects: 510, done.

Connection to git-codecommit.us-west-2.amazonaws.com closed by remote

host. fatal: The remote end hung up unexpectedly fatal: early EOF

fatal: index-pack failed

How to resolve this error and why I got this error?


Edit: I have already tried it but did not succeed:

#Windows
set GIT_TRACE_PACKET=1
set GIT_TRACE=1
set GIT_CURL_VERBOSE=1

and

git config --global ssh.postBuffer 524288000 

回答1:


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.

  1. git config --global http.postBuffer 524288000
  2. git config --global http.postBuffer 1048576000

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.

Configure on server
Edit

~/.ssh/config  
ServerAliveInterval 60
ServerAliveCountMax 5

Configure on client Edit on /etc/ssh/sshd_config

ClientAliveInterval 60
ClientAliveCountMax 5

e.g.

echo 'ClientAliveInterval 60' | sudo tee --append /etc/ssh/sshd_config

EDIT: git config --global ssh.postBuffer 1048576000

Try increasing the buffer, i face the same probelm in my repository.



来源:https://stackoverflow.com/questions/59353753/git-clone-fails-fatal-the-remote-end-hung-up-unexpectedly-fatal-early-eof-f

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!