gerrit 删除仓库

kevin.Zhu 发布于:2022-7-22 15:18 分类:文摘  有 20 人浏览,获得评论 0 条  

https://www.csdn.net/tags/MtTaEg3sNzg5OTg2LWJsb2cO0O0O.html

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