当我试图逃跑的时候

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

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


当前回答

您可能会得到这样的错误

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

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

git config --global 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>

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

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

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

您可能在现有的存储库中克隆了存储库,要解决这个问题,可以简单地在另一个目录中克隆存储库,并将更改复制到这个新目录,然后运行推送。

基于您正在使用的推送到回购的协议

HTTP

git config --global http.postBuffer 157286400

引用:

https://git-scm.com/docs/git-config#Documentation/git-config.txt-httppostBuffer

SSH

在~/中添加以下内容。Linux机器中的Ssh /config文件

Host your-gitlab-server.com
  ServerAliveInterval 60
  ServerAliveCountMax 5
  IPQoS throughput

引用:

https://docs.gitlab.com/ee/topics/git/troubleshooting_git.html#check-your-ssh-configuration https://unix.stackexchange.com/questions/3026/what-options-serveraliveinterval-and-clientaliveinterval-in-sshd-config-exac https://communities.vmware.com/message/2778248