【问题标题】:Git push Error: RPC failed; result=22, HTTP code = 502Git推送错误:RPC失败;结果 = 22,HTTP 代码 = 502
【发布时间】:2021-01-15 01:32:32
【问题描述】:

我正在尝试使用 git 将一个大型项目添加到 GitLab,除了文件夹之外的所有内容都对我有用。此文件夹包含网站的所有媒体(仅 jpg 和 pdf)(5GB)。

因此,如果我执行以下操作: git add .,它会添加除此文件夹之外的所有内容。我稍后必须添加:add -f

当我尝试推送此文件夹时,出现以下错误:

- Via http:

[aritz@localhost html]$ git push -u originhttp master
Username for 'https://gitlab.com': *******
Password for 'https://*******@gitlab.com':
Counting objects: 11006, done.
Compressing objects: 100% (9541/9541), done.
Writing objects: 100% (11003/11003), 2.99 GiB | 7.25 MiB/s, done.
Total 11003 (delta 895), reused 0 (delta 0)
error: RPC failed; result=22, HTTP code = 520
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
Everything up-to-date

- Via SSH:

[aritz@localhost html]$ git push -u origin master
Counting objects: 11006, done.
Connection to gitlab.com closed by remote host.
fatal: The remote end hung up unexpectedly
Compressing objects: 100% (9541/9541), done.
error: pack-objects died of signal 13
error: failed to push some refs to 'git@gitlab.com:****/*********.git'

我尝试过的:

- Remove proxy
git config --global --unset http.proxy
git config --global --unset https.proxy

- Add data:
git config --global user.name ""
git config --global user.email ""

- Expand postBuffer:
git config --global http.postBuffer 157286400
git config --global http.postBuffer 524288000

我还查看了 httpd 日志,但没有看到任何相关内容。并且文件夹的权限和其他文件一样。

最后,作为替代选项,我尝试为该文件夹创建一个空存储库:

在这种情况下,我可以执行 git add 。不必强迫它。但是当我尝试推动这是结果:

- Via ssh:

[aritz@localhost resources]$ git push -u originssh master
Counting objects: 11086, done.
Connection to gitlab.com closed by remote host.
fatal: The remote end hung up unexpectedly
Compressing objects: 100% (9623/9623), done.
error: pack-objects died of signal 13
error: failed to push some refs to 'git@gitlab.com:*****/*********.git'

- Via http:

[aritz@localhost resources]$ git push -u origin master
Username for 'https://gitlab.com': ********
Password for 'https://********@gitlab.com': 
Counting objects: 11086, done.
Compressing objects: 100% (9623/9623), done.
Writing objects: 100% (11086/11086), 2.99 GiB | 5.97 MiB/s, done.
Total 11086 (delta 892), reused 0 (delta 0)
error: RPC failed; result=22, HTTP code = 502
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
Everything up-to-date

在我的许多尝试中,我设法让它工作,但虽然我相信我已经按照以前的相同步骤进行操作,但我无法让它再次工作。

【问题讨论】:

    标签: git http ssh centos gitlab


    【解决方案1】:

    如果大文件是二进制文件,您可以使用 Git LFS,如果不需要,这将允许将二进制文件与存储库分开,这样用户就不必下载整个存储库和二进制文件,并且这样可以节省时间。

    有关 Git LFS 的更多信息,请访问以下网页,https://docs.gitlab.com/ee/administration/lfs/

    【讨论】:

    • 这似乎是我的解决方案。我不知道 gitLab 是否应该接受我的文件(它们不是很大的文件,但它们整体占用 5 GB),但是有了这个工具,我已经能够做我想做的事。我不知道git LFS,非常感谢!我将问题设置为已解决
    猜你喜欢
    • 2014-04-17
    • 1970-01-01
    • 2014-05-17
    • 1970-01-01
    • 2015-06-15
    • 1970-01-01
    • 2020-10-09
    • 2013-10-27
    相关资源
    最近更新 更多