当我试图逃跑的时候

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子模块,通过以下方法解决:

git fetch 

然后在开发的分支上创建任何提交。

git push origin develop
git pull origin develop 

其他回答

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

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

您可能会得到这样的错误

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

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

git config --global http.postBuffer 524288000

在我们的案例中,问题是一个克隆程序编写了一个.git/config文件,其中包含一个url条目,该url条目是一个只读访问方法。将url从://方法更改为@方法解决了这个问题。

运行git remote -v可以解释这个问题。

我不认为这是一个好主意,但如果你有备份在你的机器..再推一次,然后尝试克隆repo,然后从旧目录中删除.git,并从新的克隆文件夹中移动.git。Git已解决,但由于这个问题,一些文件可能无法在Git上上传。再次从你的备份,然后把它拉到你的服务器或其他机器,它得到curcurt。现在我刚做了这个…对我有用。在这样做之前,备份一下你的文件夹。

如果我说错了,请指正。我也不知道这样做之后会出什么问题?但这次真的管用了。

添加一个答案似乎是毫无意义的,但是当我最终发现它是Visual Studio Online正在遭受零星的停机时,我一直在努力解决这个问题。当VS不断提示积分时,这一点变得很明显,VSO网站有时会给出500分。

Counting objects: 138816, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (38049/38049), done.
error: unable to rewind rpc post data - try increasing http.postBuffer
error: RPC failed; curl 56 SSL read: error:00000000:lib(0):func(0):reason(0), errno 10054
The remote end hung up unexpectedly/138816), 33.30 MiB | 3.00 KiB/s
Writing objects: 100% (138816/138816), 50.21 MiB | 3.00 KiB/s, done.
Total 138816 (delta 100197), reused 134574 (delta 96515)
fatal: The remote end hung up unexpectedly
Everything up-to-date

后来我把我的HTTP帖子缓冲区设置回2 MB,因为我认为它对许多较小的帖子工作得更好。