GitLab无法提交大文件的问题
问题描述
GitLab 当提交大文件时遇到如下报错
MYOPS001@MYOPS001 MINGW64 /e/work/GitLab/system-deploy (main)
$ git push
Enumerating objects: 91, done.
Counting objects: 100% (91/91), done.
Delta compression using up to 16 threads
Compressing objects: 100% (79/79), done.
error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413
send-pack: unexpected disconnect while reading sideband packet
Writing objects: 100% (90/90), 138.21 MiB | 7.21 MiB/s, done.
Total 90 (delta 10), reused 0 (delta 0), pack-reused 0
fatal: the remote end hung up unexpectedly
Everything up-to-date
可能原因
http不支持大文件传输,ssh可以支持的
排查
查看使用的啥协议
git remote -v
origin https://192.168.155.12:28886/system/trading/system-deploy.git (fetch)
origin https://192.168.155.12:28886/system/trading/system-deploy.git (push)
设置ssh方式提交
MYOPS001@MYOPS001 MINGW64 /e/work/GitLab/system-deploy (main)
$ git remote set-url origin git@192.168.155.12:system/trading/system-deploy.git
生成公私钥完成SSH登录
windows+r打开cmd执行
ssh-keygen
#一路回车
在git上配置公钥即id_rsa.pub的内容
在自己的对应的文件名下设置
C:\Users\MYOPS001\.ssh
在对应目录新建config文件内容如下,如果默认端口是22端口则不需要设置此文件
Host 192.168.155.12
Port 2222
执行推送命令
MYOPS001@MYOPS001 MINGW64 /e/work/GitLab/system-deploy (main)
$ git push
The authenticity of host '[192.168.155.12]:2222 ([192.168.155.12]:2222)' can'tbe established.
ED25519 key fingerprint is SHA256:oPRSGSYC6tC/94ZgU9jIS5AVWriAnNXe/4Udg1/WYcU.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '[192.168.155.12]:2222' (ED25519) to the list of kno
wn hosts.
Enumerating objects: 91, done.
Counting objects: 100% (91/91), done.
Delta compression using up to 16 threads
Compressing objects: 100% (79/79), done.
Writing objects: 100% (90/90), 138.21 MiB | 5.43 MiB/s, done.
Total 90 (delta 10), reused 0 (delta 0), pack-reused 0
To 192.168.155.12:system/trading/system-deploy.git88a32be..b1d12a8 main -> mainMYOPS001@MYOPS001 MINGW64 /e/work/GitLab/system-deploy (main)
参考:https://cloud.tencent.com/developer/article/1612644
https://blog.csdn.net/m0_55868614/article/details/120597702