将提交推送到 github 时 Git 失败

标签 git github rpc

我将托管在 github 上的一个 git 存储库克隆到了我的笔记本电脑上。我能够毫无问题地成功地将几个提交推送到 github。但是,现在我收到以下错误:

Compressing objects: 100% (792/792), done.
error: RPC failed; result=22, HTTP code = 411
Writing objects: 100% (1148/1148), 18.79 MiB | 13.81 MiB/s, done.
Total 1148 (delta 356), reused 944 (delta 214)

从这里它只是挂起,我最后不得不 CTRL + C 回到终端。

最佳答案

我遇到了同样的问题,并且认为它与您尝试推送的存储库的大小(编辑后的或特定文件的大小)有关。

基本上我能够创建新的存储库并将它们推送到 github。但是现有的一个是行不通的。

HTTP 错误代码似乎支持我,它是“需要长度”错误。所以也许它太大而无法计算或大于最大值。谁知道。

编辑

I found that the problem may be files that are large. I had one update that would not push even though I had successful pushes up to that point. There was only one file in the commit but it happened to be 1.6M

So I added the following config change

git config http.postBuffer 524288000

To allow up to the file size 500M and then my push worked. It may have been that this was the problem initially with pushing a big repo over the http protocol.

结束编辑

我让它工作的方法(在我修改 postBuffer 之前进行编辑)是对我的存储库加 tar,将它复制到一台可以通过 ssh 执行 git 的机器,然后将它推送到 github。然后,当您尝试从原始服务器执行推/pull 操作时,它应该可以通过 https 工作。 (因为它的数据量比原始推送少得多)。

关于将提交推送到 github 时 Git 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2702731/

相关文章:

github - 在 IntelliJ 中,如何更新现有的要点而不是创建要点?

c - RPC float 结果错误

erlang - 在erlang中向远程节点端口发送消息

git - 有哪些可以在 Windows Powershell 中使用的 Gitk 替代品?

git - 回滚到公共(public)仓库中的旧 Git 提交

git - 如何推送和自动更新我的非裸远程 git 存储库的工作副本?

github 'resolve conflicts' 按钮已禁用

github - 如何从浏览器使用 GitHub 代码导航?

http - 从GWT开始,使用RPC调用重要吗?

django - 如何将 django 项目拆分为单独的已创建应用程序?