Gerrit 使用

论坛 期权论坛 脚本     
匿名网站用户   2020-12-20 12:09   11   0
参考Gerrit的使用说明
ssh-p29418hwh@188.188.1.9gerrit--help
可以查看每一个命令的说明:比如create-project
ssh-p29418hwh@188.188.1.9gerritcreate-project--help

1.创建项目(必须要有管理员权限)
ssh-p29418hwh@188.188.1.9gerritcreate-project-pAll-Projects-nArt--empty-commit
可以在本机上使用:29418 gerrit服务器端口,hwh是gerrit账号,188.188.1.9服务器地址
gerritcreate-project 用gerrit来创建项目-pAll-Projects 权限从All-Projects继承 p是父项目
-nArt project名字是Art--empty-commit 项目创建时,加一个空提交。
2.删除gerrit用户
ssh-p29418zbb@review.mdaxue.comgerritgsql
deletefromACCOUNT_EXTERNAL_IDSwhereexternal_id='username:zzy';
3、从git服务器获取代码
gitclonessh://hwh@188.188.1.9:29418/Art
4.创建http登录帐号
htpasswd-b./review_site/etc/passwdhwh 123456
更新账户,htpasswd-b./review_site/etc/passwdhwh 12345678
5.管理员创建邮箱
回到本机通过ssh远程连接创建邮箱
$cat~/.ssh/config
Hostha
HostName192.168.1.99
Userroot
Port29418
IdentityFile~/.ssh/id_rsa

$sshhagerritset-account--add-emailaccountemailaccountname

6、删除项目
到gerrit服务器里,直接删除该项目比如:test.git
重启gerrit服务器,进去看list,发现这个项目没有了。

7、push代码和tags
gitpush--tagsoriginHEAD:refs/heads/qmc-8974-la-4.0.2-ref
把从高通下载的代码和tag一起push到服务器,结果是代码可以push,tag不能。

自己新建一个git,加上代码和tag,push的服务器,结果是可以push。

查找权限,refs/heads/*已经有权限了,可以push code,所以我们要查找tag的权限,refs/tags/*的权限也都有了。所以我们自己的git可以push code和代码,但是为什么别人的code不能push tag呢?需要加Forge Author Identity和Forge Committer Identity



ForgeAuthor
NormallyGerritrequirestheauthorandthecommitteridentitylinesinaGitcommitobject(ortaggerlineinanannotatedtag)tomatchoneoftheregisteredemailaddressesoftheuploadinguser.Thispermissionallowsuserstobypasspartsofthatvalidation,whichmaybenecessarywhenmirroringchangesfromanupstreamproject.

Permitstheuseofanunverifiedauthorlineincommitobjects.Thiscanbeusefulwhenapplyingpatchesreceivedbyemailfrom3rdparties,whencherry-pickingchangeswrittenbyothersacrossbranches,orwhenamendingsomeoneelse’scommittofixupaminorproblembeforesubmitting.

BydefaultthisisgrantedtoRegisteredUsersinallprojects,butasiteadministratormaydisableitifverifiedauthorshipisrequired.

ForgeCommitter
NormallyGerritrequirestheauthorandthecommitteridentitylinesinaGitcommitobject(ortaggerlineinanannotatedtag)tomatchoneoftheregisteredemailaddressesoftheuploadinguser.Thispermissionallowsuserstobypasspartsofthatvalidation,whichmaybenecessarywhenmirroringchangesfromanupstreamproject.

Allowstheuseofanunverifiedcommitterlineincommitobjects,oranunverifiedtaggerlineinannotatedtagobjects.Typicallythisisonlyrequiredwhenmirroringcommitsfromanupstreamprojectrepository.

ForgeServer
NormallyGerritrequirestheauthorandthecommitteridentitylinesinaGitcommitobject(ortaggerlineinanannotatedtag)tomatchoneoftheregisteredemailaddressesoftheuploadinguser.Thispermissionallowsuserstobypasspartsofthatvalidation,whichmaybenecessarywhenmirroringchangesfromanupstreamproject.

Allowstheuseoftheserver’sownnameandemailonthecommitterlineofanewcommitobject.Thisshouldonlybenecessarywhenforcepushingacommithistorywhichhasbeenrewrittenbygitfilter-branchandthatcontainsmergecommitspreviouslycreatedbythisGerritCodeReviewserver.

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:1136255
帖子:227251
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP