Git push Error: RPC failed; result=22, HTTP code = 502

Git push Error: RPC failed; result=22, HTTP code = 502

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

因此,如果我执行以下操作:git 添加 .,它会添加除此文件夹之外的所有内容。我稍后必须添加: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 添加。而不必强迫它。但是当我尝试推送时,结果是:

- 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 LFS,如果不需要,这将允许将二进制文件与存储库分开,因此用户不必下载整个存储库,使用二进制文件,这样可以节省时间。

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