当我试图逃跑的时候

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

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


当前回答

我在拉的时候也犯了同样的错误。 我已经完成了http。postBuffer”技巧。它解决了这个问题,但是当我想要推的时候,我又遇到了错误。

解决我问题的方法是: 1. 将其克隆到其他虚拟机的其他文件夹。(Linux)。 2. 我已经做了我的改变。 3.用我最初无法操作的原始虚拟机推动它。(窗口)

其他回答

原因:Git的默认文件大小已经超过。

解决方案:导航到repo。进入存储库后,运行如下命令将缓冲区增加到500MB:

git config http.postBuffer 524288000

我通过重新包装解决了这个问题:

git repack --max-pack-size=100M -a -d

在GitHub桌面的命令提示符中打开知识库> 执行如下命令:

set GIT_TRACE=1
set GIT_CURL_VERBOSE=1
git push origin <branch>

如果您正在使用windows版本的git(如果您在windows机器上执行此操作,则很可能是这样),并且这里的其他修复都不适合您,请尝试访问https://github.com/git-for-windows/git/releases,获取2.4.5版本或之后的版本。帮我搞定了。

我能够使用Git Shell解决这个问题。

github.com中的每个存储库都为您提供了HTTPS/SSH/Subversion URL,您可以使用Shell下载,请参阅这里:http://prntscr.com/8ydguv。 根据GitHub最近的变化,SSH似乎是最好的方法。

在Shell中使用的命令:

git clone "URL of repo goes here w/ no quotes"

与其他答案之一相反——我在使用ssh推送时遇到了问题——我切换到https,它已经修复了。

git remote remove origin
git remote add origin https://github.com/user/repo
git push --set-upstream origin master