32.6 管理员访问SSH的管理接口

32.6 管理员访问SSH的管理接口 - 图1

应该放在用户本地Git库的钩子目录中以便在生成的提交中包含唯一的Change-Id。这在之前的Gerrit原理中介绍过。

除了普通用户可以执行的命令外,管理员还可以通过SSH连接执行Gerrit相关的管理命令。例如之前介绍的管理数据库:


$ssh-p 29418 localhost gerrit gsql

Welcome to Gerrit Code Review 2.1.5.1

(H2 1.2.134(2010-04-23))

Type '\h' for help.Type '\r' to clear the buffer.

gerrit>


此外管理员还可以通过SSH连接执行账号创建,项目创建等管理操作,可以执行下面的命令查看帮助信息。


$ssh-p 29418 localhost gerrit—help

gerrit COMMAND[ARG…][—][—help(-h)]

—:end of options

—help(-h):display this help text

Available commands of gerrit are:

approve

create-account

create-group

create-project

flush-caches

gsql

ls-projects

query

receive-pack

replicate

review

set-project-parent

show-caches

show-connections

show-queue

stream-events

See 'gerrit COMMAND—help' for more information.


更多的帮助信息,还可以参考Gerrit版本库中的帮助文件:Documentation/cmd-index.html。