This plugin provides a group per user. This is useful to assign access rights directly to a single user, since in Gerrit access rights can only be assigned to groups.
ssh -p 29418 admin@localhost gerrit --help
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
gsql Administrative interface to active database
index
logging
ls-groups List groups visible tothe caller
ls-members List the members of a given group
ls-projects List projects visible tothe 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
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 referencefor a project
set-members Modify members of specific group ornumberof groups
set-project Change a project's settings
set-project-parent Change the project permissions are inherited fromset-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 inrealtime
test-submit
version Display gerrit version#查看各个命令帮助
ssh -p 29418 admin@localhost gerrit <command> --help#查看缓存
ssh -p 29418 admin@localhost gerrit show-caches
#在一些项目/用户权限修改时,清除缓存
ssh -p 29418 admin@localhost gerrit flush-caches --all#通过gerrit登录数据库
ssh -p 29418 admin@localhost gerrit gsql
fatal: admin doesnot have "Access Database" capability.
#修改All-Projects的refs/meta/config分支下project.config文件
[capability]
accessDatabase = group Administrators
#查看可见的群组
ssh -p 29418 admin@localhost gerrit ls-groups
#创建新的项目,--owner需要的群组必须要在Gerrit已经定义好的
ssh -p 29418 admin@localhost gerrit create-project "test/helloworld"--description "'Tools used by build system'" --owner "user/admin" --parent "All-Projects"#修改项目配置
ssh -p 29418 admin@localhost gerrit set-project "repo_name"--project-state ACTIVE --submit-type FAST_FORWARD_ONLY#设置继承项目
ssh -p 29418 admin@localhost gerrit set-project-parent "repo_name"--parent "parent_repo"#自动审查打分
ssh -p 29418 admin@localhost gerrit review {COMMITID | CHANGEID,PATCHSET} --verified +1 --code-review +1 --message "review from ssh"
#停止gerrit
./bin/gerrit.sh stop
java -jar bin/gerrit.war gsql
Type'\h'for help. Type'\r'to clear the buffer.
gerrit> \h
General
\q quit
Informational
\d list all tables
\d NAME describe table
#查询账号信息
SELECT * FROM ACCOUNTS;
#更新邮箱
UPDATE ACCOUNTS SET PREFERRED_EMAIL='email'WHERE ACCOUNT_ID = '1000000';
UPDATE ACCOUNT_EXTERNAL_IDS SET EMAIL_ADDRESS='2290910211@qq.com'WHERE ACCOUNT_ID = '1000000';
遇见的问题
1. Cannot initialize schema
Exception in thread "main"com.google.gwtorm.server.OrmException: Cannot initialize schema
at com.google.gerrit.server.schema.SchemaUpdater.update(SchemaUpdater.java:101)
at com.google.gerrit.pgm.init.BaseInit$SiteRun.upgradeSchema(BaseInit.java:339)
at com.google.gerrit.pgm.init.BaseInit.run(BaseInit.java:120)