当我试图逃跑的时候

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 repack --max-pack-size=100M -a -d

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

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

其他回答

我的问题(致命:远程端意外挂起)已通过检查存储库权限和所有者解决。

Git存储库文件的所有者必须是你想要用它推送/拉/克隆的用户。

我收到了与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)

然后就成功了。

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

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

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

有同样的问题,尝试所有答案不工作,只是尝试另一个帐户,这为我工作。

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

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

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