当我试图逃跑的时候

git push origin master --force

我刚刚

Counting objects: 2649, done.
Delta compression uses 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

这和缺乏安全感有关吗?我尝试创建一个公钥作为致命的答案:远程端意外挂断并重新运行它,但它仍然不工作。我不是在用钥匙吗?如果是,我该如何使用它?


当前回答

这是由于git/https缓冲区设置。

运行这个(从Git中获取的文件在提交到github时失败):

git config http.postBuffer 524288000

然后,再次运行原来的命令。

其他回答

这看起来类似于我如何让github默认为ssh,而不是https的新存储库。 也许从http协议切换到ssh协议是值得的:

$ git remote add origin git@github.com:username/project.git

这篇文章有很好的解释,它解决了我的问题。

git config --global http.postBuffer 157286400

https://confluence.atlassian.com/stashkb/git-push-fails-fatal-the-remote-end-hung-up-unexpectedly-282988530.html

对于我来说,当我试图从一个甚至不存在的分支中拉时,我得到了相同的错误。

因此,请在您执行操作时检查分支名称。

下面的命令可能会帮助你…

git config --global http.postBuffer 1048576000
git config --global http.lowSpeedLimit 0
git config --global http.lowSpeedTime 999999

另一个补充,因为我遇到这个错误不同的方式和谷歌把我带到这里。

我的问题是箱子不匹配;一只骆驼箱,一只没有。显然,GIT会在不告诉你原因的情况下阻止你这么做。因此,如果您的分支只在大小写上与远程分支不同,请尝试将它们更改为相同。

看到的: Git:合并后'Master无法解析为分支'