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条回答
霸刀☆藐视天下
2楼-- · 2019-01-03 01:03

Other solutions didn't work in my case, doing a garbage collection fixed it for me:

git gc --aggressive

查看更多
Fickle 薄情
3楼-- · 2019-01-03 01:05

If you are using git for windows (and you likely are, if you are doing this on a windows machine), and none of the other fixes here worked for you, try going to https://github.com/git-for-windows/git/releases, and getting a version on or after version 2.4.5. Fixed it right up for me.

查看更多
Viruses.
4楼-- · 2019-01-03 01:06

Contrary to one of the other answers - I had the problem on push using ssh - I switched to https and it was fixed.

git remote remove origin
git remote add origin https://github..com/user/repo
git push --set-upstream origin master
查看更多
啃猪蹄的小仙女
5楼-- · 2019-01-03 01:06

I got this error when I had misspelt my remote branch name

查看更多
放荡不羁爱自由
6楼-- · 2019-01-03 01:09

I have the same problem. I noticed from the git web page that the SSH clone URL have the next structure:

git@github.com:user/project.git

I could resolve my problem just changing the ":" by "/", as follows:

git@github.com/user/project.git

may be this can be helpful.

查看更多
乱世女痞
7楼-- · 2019-01-03 01:09

Do this to see the key you're using; ssh -vT git@github.digitalglobe.com

Then make sure in your build you have this run at the start. eval "$(ssh-agent -s)" ssh-add ~/.ssh/id_rsa

查看更多
登录 后发表回答