当我试图逃跑的时候

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

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


当前回答

我也得到了这个错误。第二次推就成功了

其他回答

即使配置了后缓冲区,这个问题也没有解决。

当我把我的wifi网络从宽带改为移动热点时,我的问题解决了。这可能不是逻辑上正确的答案,但它解决了问题。

确保你有良好的网速。

上面的答案对我都没用,但下面的答案对我有用。

从项目中删除.git/ 克隆远程回购到一些新的位置,如你的桌面: Git克隆https://github.com/foo/bar.git 将.git/从新位置移动到旧位置 重新提交并推动您的更改

在我的情况下,我得到了这个错误,当推动与Intellij Idea。

以下是我如何追踪我的错误并修复它。

在终端中启用调试日志记录,这从来都不是一个坏主意:)

set GIT_CURL_VERBOSE=1 set GIT_TRACE=1 

通过终端推送,而不是通过intellij推送

git push 
-> fatal: The current branch feature/my-new-feature has no upstream branch.
To push the current branch and set the remote as upstream

解决方案是设置上游,这一定是之前出了问题:

git push --set-upstream origin feature/my-new-feature

其他解决方案在我的情况下不起作用,做垃圾收集为我解决了这个问题:

git gc --aggressive

你可以先试试git gc。

我尝试了上面的大部分选择,没有一个对我有效, 但这是可行的

Git重置origin/branch_name——force

这可能会起作用,但你会失去你的工作 您可以复制更改到git的旧或新位置。