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:27

In our case, the problem was a clone that wrote a .git/config file which contained a url entry that was a read only access method. Changing the url from the :// method to the @ method fixed the problem.

Running git remote -v illuminated the issue some.

查看更多
仙女界的扛把子
3楼-- · 2019-01-03 01:27

Another addition, since I encountered this error a different way and Google took me here.

My problem was a mismatch of case; one camelCase and one not. Apparently, GIT stops you doing this without telling you why. So if your branches are different from the remote only in the capitalization, try changing them to be identical.

See: Git: 'Master cannot be resolved to branch' after merge

查看更多
一夜七次
4楼-- · 2019-01-03 01:28

You might get an error like this

error: could not lock config file .git/config: No such file or directory

that is because you dont have a local .git/config file You can get it working by this command

git config --global http.postBuffer 524288000

查看更多
登录 后发表回答