[关闭]
@zongwu 2017-06-01T07:12:49.000000Z 字数 833 阅读 491

Gerrit 内部使用手册

扑咚健康


配置自己电脑的hosts文件

新增一条记录,映射到gerrit.healthbok-inc.com

  1. 172.16.8.191 gerrit.healthbok-inc.com

要把id_rsa.pub配置到gerrit.healthbok-inc.com中

image.png-82.6kB

先配置本机的.ssh/config文件,若没有新建即可

  1. Host gerrit.healthbok-inc.com
  2. HostName 172.16.8.191
  3. Port 29418
  4. IdentityFile ~/.ssh/id_rsa
  5. KexAlgorithms diffie-hellman-group1-sha1
  6. PubkeyAcceptedKeyTypes +ssh-dss
  7. HostKeyAlgorithms +ssh-dss

参考资料:https://wiki.archlinux.org/index.php/Secure_Shell#Using_OpenSSH_with_legacy_SSH_implementations

克隆仓库

  1. git clone ssh://junqi.chen@gerrit.healthbok-inc.com/pdactivity.git

设置git hook:commit-msg

commit-msg的脚本下载地址:http://gerrit.healthbok-inc.com/tools/hooks/commit-msg

image.png-245.4kB

修改提交

注意查看git的全局的邮件地址的配置,可以使用命令git config -l查看全局的配置。
其中配置的地址要与 gerrit 设置的一致。

image.png-22.8kB
image.png-97.2kB

否则推送会产生异常。
image.png-316.1kB

确保上述均无问题之后,可以尝试推送。

  1. git push origin master:refs/for/master

去gerrit网站确认推送是否成功

gerrit 地址:http://gerrit.healthbok-inc.com/
注意一定要使用自己的帐号与密码登录,因为gerrit貌似有问题,无法注销登录的。

image.png-60.9kB

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注