Git, fatal: The remote end hung up unexpectedly

2019-01-03 00:42发布

When I tried to run

git push origin master --force

I just got

Counting objects: 2649, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (1280/1280), done.
error: RPC failed; result=22, HTTP code = 413 | 116 KiB/s   
fatal: The remote end hung up unexpectedly
Writing objects: 100% (2504/2504), 449.61 MiB | 4.19 MiB/s, done.
Total 2504 (delta 1309), reused 2242 (delta 1216)
fatal: The remote end hung up unexpectedly
Everything up-to-date

Is it something to do with not being secure? I tried creating a public key as in the answer for Fatal: The remote end hung up unexpectedly and running it again, but it still doesn't work. Am I not actually using the key? If so, how do I use it?

21条回答
Viruses.
2楼-- · 2019-01-03 01:21

You probably did clone the repository within an existing one, to solve the problem can simply clone of the repository in another directory and replicate the changes to this new directory and then run the push.

查看更多
Deceive 欺骗
3楼-- · 2019-01-03 01:21

Seems almost pointless to add an answer, but I was fighting this for ages when I finally discovered it was Visual Studio Online that was suffering a sporadic outage. That became apparent when VS kept prompting for creds and the VSO website sometimes gave a 500.

Counting objects: 138816, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (38049/38049), done.
error: unable to rewind rpc post data - try increasing http.postBuffer
error: RPC failed; curl 56 SSL read: error:00000000:lib(0):func(0):reason(0), errno 10054
The remote end hung up unexpectedly/138816), 33.30 MiB | 3.00 KiB/s
Writing objects: 100% (138816/138816), 50.21 MiB | 3.00 KiB/s, done.
Total 138816 (delta 100197), reused 134574 (delta 96515)
fatal: The remote end hung up unexpectedly
Everything up-to-date

I set my HTTP post buffer back to 2Mb afterwards, since I actually think it works better with many smaller posts.

Luke

查看更多
劫难
4楼-- · 2019-01-03 01:25

The problem is due to git/https buffer settings. In order to solve it (taken from Git fails when pushing commit to github)

git config http.postBuffer 524288000

And run the command again

查看更多
相关推荐>>
5楼-- · 2019-01-03 01:25

I was able to get around this issue using Git Shell.

Each repository within github.com gives you HTTPS/SSH/Subversion URL's that you can use to download using Shell, see here: http://prntscr.com/8ydguv.
Based on GitHub's recent changes, SSH seems to be the best method.

Command to use in Shell:

git clone "URL of repo goes here w/ no quotes"
查看更多
迷人小祖宗
6楼-- · 2019-01-03 01:26

1) cd to the project dir

2) git status

3) git checkout -f HEAD

4) confirm success by pulling down master again to make sure you're up to date if your repo looked incomplete

This works if you get the error in question from Visual Studio's Git when cloning a repo from Bitbucket

查看更多
叛逆
7楼-- · 2019-01-03 01:27

Cause : The default file post size for Git has been exceeded.

Solution :

Navigate to repo.

Run the following command to increase the buffer to 500MB after navigating to the repository:

git config http.postBuffer 524288000
查看更多
登录 后发表回答