1. 登录数据库
直接登录gerrit服务器,关闭gerrit服务后,用下面的命令启动:
java -jar gerrit-2.3.war gsql -d ./review_site/
java -jar gerrit.war gsql -d ~/review_site/
(注意:这种方式注意gerrit被stop掉)
2. 创建HTTP用户
首次使用
sudo htpasswd -cb /etc/apache2/passwords user1 password1
以后使用
sudo htpasswd -b /etc/apache2/passwords test1 test1
更改用户密码
sudo htpasswd /etc/apache2/passwords user001
如何不更新密码文件,只显示加密后的用户名和密码?
sudo htpasswd -nb /etc/apache2/passwords pass
不更新.passwd文件,只在屏幕上输出用户名和经过加密后的密码
如何利用htpasswd命令删除用户名和密码?
sudo htpasswd -D .passwd tonyzhang
如何利用htpasswd命令修改密码?
sudo htpasswd -D .passwd tonyzhang
sudo htpasswd -b .passwd tonyzhang pass
3. gerrit命令帮助
ssh -p 29418 scm@192.168.134.80 gerrit --help
(注意: 确保gerrit被启动)
3.1 设置账户邮件
ssh -p 29418 scm@192.168.134.80 gerrit set-account --add-email xxxxxxx@xxxx.com accountname
3.2 管理员创建project或上传已有的project
New project from scratch
If you choose to create a new repository from scratch, it’s easier for you to create a project with an initial commit in it. That way first time setup between client and server is easier.
This is done via the SSH port:
user@host:~$ ssh -p 29418 user@localhost gerrit create-project --empty-commit --name demo-project
user@host:~$
This will create a repository that you can clone to work with.
Already existing project
The other alternative is if you already have a git project that you want to try out Gerrit on. First you have to create the project. This is done via the SSH port:
user@host:~$ ssh -p 29418 user@localhost gerrit create-project --name demo-project
ssh -p 29418 admin@192.168.134.59 gerrit create-project --name demo-project
user@host:~$
user@host:~/my-project$ git push ssh://user@localhost:29418/demo-project *:*
git push ssh://admin@192.168.134.59:29418/demo-project *:*
4.1 添加+2权限
创建一个新的group,并加入members(在web段),进入access,将新group放入+2
4.2 创建新branch
一,直接以管理员账户push
二,普通用户,可通过临时添加group,并将group在access中授予push权限。
5. 由gerrit上获取的代码往github上push
git push git@github.com:KsoNew/Email Header_PartialDownload
ssh -P 29418 192.168.134.59 gerrit review $commithash \ --code-review +2 -s
5. git tag
添加tag
git tag -a tag_name -m 'description' (commit id)
pushtag
git push origin tag_name:refs/tags/tag_name
直接登录gerrit服务器,关闭gerrit服务后,用下面的命令启动:
java -jar gerrit-2.3.war gsql -d ./review_site/
java -jar gerrit.war gsql -d ~/review_site/
(注意:这种方式注意gerrit被stop掉)
2. 创建HTTP用户
首次使用
sudo htpasswd -cb /etc/apache2/passwords user1 password1
以后使用
sudo htpasswd -b /etc/apache2/passwords test1 test1
更改用户密码
sudo htpasswd /etc/apache2/passwords user001
如何不更新密码文件,只显示加密后的用户名和密码?
sudo htpasswd -nb /etc/apache2/passwords pass
不更新.passwd文件,只在屏幕上输出用户名和经过加密后的密码
如何利用htpasswd命令删除用户名和密码?
sudo htpasswd -D .passwd tonyzhang
如何利用htpasswd命令修改密码?
sudo htpasswd -D .passwd tonyzhang
sudo htpasswd -b .passwd tonyzhang pass
3. gerrit命令帮助
ssh -p 29418 scm@192.168.134.80 gerrit --help
(注意: 确保gerrit被启动)
3.1 设置账户邮件
ssh -p 29418 scm@192.168.134.80 gerrit set-account --add-email xxxxxxx@xxxx.com accountname
3.2 管理员创建project或上传已有的project
New project from scratch
If you choose to create a new repository from scratch, it’s easier for you to create a project with an initial commit in it. That way first time setup between client and server is easier.
This is done via the SSH port:
user@host:~$ ssh -p 29418 user@localhost gerrit create-project --empty-commit --name demo-project
user@host:~$
This will create a repository that you can clone to work with.
Already existing project
The other alternative is if you already have a git project that you want to try out Gerrit on. First you have to create the project. This is done via the SSH port:
user@host:~$ ssh -p 29418 user@localhost gerrit create-project --name demo-project
ssh -p 29418 admin@192.168.134.59 gerrit create-project --name demo-project
user@host:~$
user@host:~/my-project$ git push ssh://user@localhost:29418/demo-project *:*
git push ssh://admin@192.168.134.59:29418/demo-project *:*
单独上传某一个分支:
git push ssh://username@192.168.134.59:29418/Server branchname:branchname
4.1 添加+2权限
创建一个新的group,并加入members(在web段),进入access,将新group放入+2
4.2 创建新branch
一,直接以管理员账户push
二,普通用户,可通过临时添加group,并将group在access中授予push权限。
5. 由gerrit上获取的代码往github上push
git push git@github.com:KsoNew/Email Header_PartialDownload
ssh -P 29418 192.168.134.59 gerrit review $commithash \ --code-review +2 -s
5. git tag
添加tag
git tag -a tag_name -m 'description' (commit id)
pushtag
git push origin tag_name:refs/tags/tag_name