Why do I get error: RPC failed; result=52, HTTP co

2019-03-12 05:13发布

I created a new repository on github and wanted to push some files. So I initialize the repository like normal and do git add . to add the current directory (which is my java project folder with bin and src folder inside). Then I added the remote directory using:

git remote add https://github.com/username/project.git

Then I made my first commit git commit -m "First Commit"

then I type git push -u origin master and I get this error:

Counting objects: 63, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (60/60), done.
Writing objects: 100% (62/62), 16.98 KiB, done.
Total 62 (delta 15), reused 0 (delta 0)
error: RPC failed; result=52, HTTP code = 0
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
Everything up-to-date

But if I add just one file and try to commit just a single file, it works.

What is going on? Why can I not commit my whole Java project? Its a pretty small project only 214k. Please help! Thanks!

9条回答
我只想做你的唯一
2楼-- · 2019-03-12 05:49

This error also happens if your HTTP post buffer is too small for the changes you want to push.

In this case, the solution is to increase it, for example using

git config http.postBuffer 524288000
查看更多
劳资没心,怎么记你
3楼-- · 2019-03-12 05:52

Now it is working! I didn't even change a thing.

This kind of an error ' result=52 ' is an error with github itself. Github.com was going down and when I tried uploading I got the error. Now the site is back up and I can commit like normal.

查看更多
ゆ 、 Hurt°
4楼-- · 2019-03-12 05:53

Bitbucket has the same error message. Often it is related to degraded server performance. Before you start doing anything else, check:

查看更多
祖国的老花朵
5楼-- · 2019-03-12 05:54

This can be also due to the following

Reason

Prescence of large files (45MB in our case)

Why

Large files cause HTTPS Timeout

Solution

Use SSH or Remove large files

查看更多
不美不萌又怎样
6楼-- · 2019-03-12 05:58

I tried this:

$ git config --global --add core.compression -1
$ git clone https://....

and it worked.

(Found here)

查看更多
ゆ 、 Hurt°
7楼-- · 2019-03-12 06:01

I ran into this problem when trying to clone/fetch from a Bitbucket repository over http. It turns out the repository is too big (+1gb) and Bitbucket replies with this error:

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

I switched to the SSH protocol and now it works fine. Afterwards, you can set the remote back to the http version if you need to, and it will keep working.

查看更多
登录 后发表回答