git push 代码的时候报错:The remote end hung up unexpectedly the remote end hung up unexpectedly RPC failed; HTTP 413 curl 22 The requested URL returned error: 413 Request Entity Too Large。

方法1:增大http post buffer

在git bash中执行:git config http.postBuffer 524288000

然后再push

但是我用这种方法不管用

(如果code = 411,则是由postBuffer引起的,可以在客户端执行

git config --global http.postBuffer 52428800,改为最大50M)

方法2:通过ssh来提交,而不是用http:可行。参考文章:(原)使用TortoiseGit提交代码push的时候报错:HTTP 413 curl 22 The requested URL returned error: 413 Request Entity Too Large - lihaiping - 博客园

因为我没有用过ssh提交,所以首先要生成ssh,这里参考git文档http://git.liebaopay.com/help/ssh/README,跟着一步步做就可以了。

最后通过ssh -T git@example.com (用你自己的git域名替换example.com),出现Welcome to GitLab,表示成功,如下:

然后:

设置git的ssh远端地址:

git remote set-url origin 项目的ssh地址

 重新push:$ git push

我到这里就成功push上去了。

Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐