GitLab无法提交大文件的问题

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端口则不需要设置此文件
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-tjPcloaP-1688009314076)(./images/image-20230629104143880.png)]

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't
 be 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.git
   88a32be..b1d12a8  main -> main

MYOPS001@MYOPS001 MINGW64 /e/work/GitLab/system-deploy (main)

参考:https://cloud.tencent.com/developer/article/1612644
https://blog.csdn.net/m0_55868614/article/details/120597702

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值