RPC failed; result=28, HTTP code = 0

2020-03-01 08:27发布

I'm trying to push my code into github, but almost everytime I meet this error

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

It's so annoying. Anyone knows how to fix this?

Update After I googled, I read that running git config --global http.postBuffer 524288000 could solve the problem. But even after I ran that command, I still met the problem.

标签: git github
5条回答
smile是对你的礼貌
2楼-- · 2020-03-01 08:58

I met the same problem( working behind a proxy and not able to access git://)

maybe it depends on the network situation?

do the "push" more times and it works for me. (pushed total 5 times, 2 successful)

btw, I am using the "https_proxy" environment variable, not the "http_proxy"

查看更多
虎瘦雄心在
3楼-- · 2020-03-01 08:59

That error code is a timeout error on the client. Although I suspect that the server-side is closing as the message suggests. To try and get more information you could try setting the environment variable GIT_CURL_VERBOSE=1 for your push eg:

GIT_CURL_VERBOSE=1 git push origin

This can give you an indication of whether it is the client timing out or the server disconnecting that is the original error. There are a number of things you might do to ensure that you're not always coming across this error.

  1. Check the timeouts on the server side, if you can control it. They may be too small. This depends on the server implementation.
  2. Check your repository for large files particularly binary files. These can be handled differently.
  3. Ensure you aren't setting http.lowSpeedLimit, http.lowSpeedTime inadvertently: they should be off by default (by looking at the code).

Large Repository

For point 2. There are a number of things you can do if you suspect that the pack you are pushing is large objects. This blog post is quite detailed on the subject:

http://blogs.atlassian.com/2014/05/handle-big-repositories-git/

I don't think the http.postBuffer is really a solution here.

查看更多
迷人小祖宗
4楼-- · 2020-03-01 09:03

It is not necessary to use SSH here as mentioned in the accepted answer. Recently got stuck with the same issue. Increase the Http default 1 MiB buffer size to a large value:

git config --global http.postBuffer 1048576000

then try git push remote branch_name.

Hope it helps somebody.

查看更多
▲ chillily
5楼-- · 2020-03-01 09:13

Use git:// or git+ssh://, not https

查看更多
Evening l夕情丶
6楼-- · 2020-03-01 09:14

Generally these error conditions and codes are due to a network misconfiguration or unreliable internet connectivity at the moment. Usually after a few tries, everything should be back to normal. Try different connection protocols if problem persists after several tries.

查看更多
登录 后发表回答