Gerrit lfs安装及配置

本文介绍了如何在Gerrit3.1.4版本中安装和配置GitLargeFileStorage(LFS),包括下载jar文件、修改配置和测试过程中的授权问题。解决方法是降低gitlfs版本以完成上传操作。
摘要由CSDN通过智能技术生成

Gerrit版本:3.1.4

lfs下载:Zuul

Gerrit CI界面已经没有3.1.4对应版本的lfs.jar了,需要从上面的页面下载。

一、安装配置lfs

将上面下载的lfs.jar放到$GERRIT_SITE/plugins目录。

修改配置文件:$GERRIT_SITE/etc/gerrit.config

增加如下配置

[lfs]
        plugin = lfs

添加配置文件:$GERRIT_SITE/etc/lfs.config

[storage]
    backend = fs
    directory = /usr/local/gerritlfs <= Default: $GERRIT_SITE/data/lfs

开启lfs:

git clone https://USER@GERRIT-SERVER/a/All-Projects
git fetch origin refs/meta/config
git checkout FETCH_HEAD
vi lfs.config
 
[lfs "^.*"]
    enabled = true
    maxObjectSize = 50m


git add .

git commit -m  "enable lfs"

git push origin HEAD:refs/meta/config

重启gerrit服务

二、测试lfs

当我用ssh测试的时候报错:

warning: Authentication error: Authentication required: Not authorized to perform operation verify lock on repository                                                                                 test/test
batch response: Authentication required: Not authorized to perform operation upload on repository test/test
error: failed to push some refs to 'ssh://xx.xx.xx.xx:29418/test/test'

网上google了一下发现把git lfs版本降低就ok了。

git lfs的安装:Git Large File Storage | Git Large File Storage (LFS) replaces large files such as audio samples, videos, datasets, and graphics with text pointers inside Git, while storing the file contents on a remote server like GitHub.com or GitHub Enterprise.

 lfs推送命令:

git lfs track filename
git add --all
git commit -m 'add file'
git push

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值