Gerrit常用命令

1、创建仓库

access_project:权限仓库,Gerrit自带的有All_project

group:用户组

ssh -p 29418 user@URL gerrit create-project project-name --branch branch-name --parent access_project --owner group --empty-commit

2、自动提交

ssh -p 29418 user@URL gerrit review {COMMITID,CHANGEID,PATCHSET} --verified +1  --code-review +2 --submit

3、修改仓库名称

ssh -p 29418 user@URL gerrit rename-project oldname newname

4、查看连接session

ssh -p 29418 user@URL gerrit show-connections
#关闭session
ssh -p 29418 user@URL gerrit close-connection 03e6007d

5、获取提交信息

URL/a/changes/changeID

6、获取某个时间段提交

URL/a/changes/?q=status:merged+branch:branch+after:2021-9-1+before:2021-9-15

7、重新加载replication插件

ssh -p 29418 user@localhost gerrit plugin reload replication

8、开启replication

ssh -p 29418 user@localhost replication start  --all

9、查看所有Gerrit命令

ssh -p 29418 user@gerrit_URL gerrit --help

Available commands of gerrit are:

   apropos              Search in Gerrit documentation
   ban-commit           Ban a commit from a project's repository
   close-connection     Close the specified SSH connection
   create-account       Create a new batch/role account
   create-branch        Create a new branch
   create-group         Create a new account group
   create-project       Create a new project and associated Git repository
   flush-caches         Flush some/all server caches from memory
   gc                   Run Git garbage collection
   index
   logging
   ls-groups            List groups visible to the caller
   ls-members           List the members of a given group
   ls-projects          List projects visible to the caller
   ls-user-refs         List refs visible to a specific user
   plugin
   query                Query the change database
   receive-pack         Standard Git server side command for client side git push
   reload-config        Reloads the Gerrit configuration
   rename-group         Rename an account group
   review               Apply reviews to one or more patch sets
   set-account          Change an account's settings
   set-head             Change HEAD reference for a project
   set-members          Modify members of specific group or number of groups
   set-project          Change a project's settings
   set-project-parent   Change the project permissions are inherited from
   set-reviewers        Add or remove reviewers on a change
   show-caches          Display current cache statistics
   show-connections     Display active client SSH connections
   show-queue           Display the background work queues
   stream-events        Monitor events occurring in real time
   test-submit
   version              Display gerrit version

10、删除Gerrit仓库

ssh -p 29418 gerrit.example.com delete-project delete --yes-really-delete my-project

11、verify +1

ssh -p 29418 user@URL gerrit review --verified +1 -m "Jenkins_URL:\ ${BUILD_URL}console" ${change},${PATCHSET}

12、添加Gerrit key

cat ~/.ssh/id_rsa.pub | ssh -p 29418 user@IP gerrit set-account --add-ssh-key - user

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值