当我试图逃跑的时候

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

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


当前回答

我在上传一个大型回购时也遇到过类似的错误,“致命:远程端意外挂起”,没有任何进一步的细节。

在做了大量研究之后,我是这样做的:

使用SSH代替HTTPS并不能解决问题。 增加http。postBuffer增量到一个很大的值,仍然是no 运气。 我想这可能是因为大文件在 回购(因为这是从perforce新迁移的回购),所以我使用LFS重新创建了回购,将largeFileThreshold设置为40m,这大大降低了回购大小(从3.5G到500M)。 我原以为这样就能解决问题,但令我吃惊的是,我还是犯了同样的错误。

最后,我突然想到,我可能正在使用一个旧的git客户端,因为我没有看到额外的错误消息。 我把git客户端升级到最新版(2.20.1),瞧,错误消失了!

其他回答

您可能会得到这样的错误

error:不能锁定配置文件。git/config:没有这样的文件或 目录

这是因为你没有本地的。git/config文件。你可以通过下面的命令让它工作:

git config --global http.postBuffer 524288000

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

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

我能够使用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"

这似乎是千百种情况中的一种。

对我来说,我最初是通过SourceTree推动master和develop (master没有变化)。将其改为开发只起了作用。

我收到了与fatal相同的错误消息:远程端意外挂断,没有一个答案解决了我的问题。我通常的工作流程是这样的:

本地签出基本分支(设置了远程源) 从本地的基分支构建子分支 完成我所有的编码 承诺我的东西 按它(然后控制台会告诉我,没有上游设置) 通过git push——set-upstream origin <远程分支名>来设置上游

之后,我的代码通常被推送-但在这种情况下,我有一个提交,我触摸110+文件,我得到了错误。

解决方案:

renaming the current local branch with git branch -m <branch name temp> checkout base branch (as it best at the same state where the local branch was created) creating the new child branch with the final name with git checkout -b <branch name> pushing the new child branch now without any commit, so that it is created at the remote side (also again by git push --set-upstream origin <remote branch name>) cherrypicking the commits from the <branch name temp> branch pushing the commits (after checking that I cherrypicked all commits in the right order, the first commit needs to be the first cherrypicked one)

然后就成功了。

希望这也能帮助到这里的一些人!:)