Gerrit 笔记

Gerrit 通过git push后增加一个中间状态, 来完成代码审批环节, 因此在git commit的时候增加了一个change id, 并且push到定制的target, 在push之后, 需要审批通过后再fetch, 将状态同步后, 才能继续push.

使用中Git相关的一些操作

1. 本地创建密钥对, 将公钥配置到Gerrit后台的用户配置下

2. Git clone之后, 需要将 commit-msg 这个hook文件放到项目的.git/hooks/ 目录下, 如果是linux系统, 需要确认这个文件是可执行的(u+x)

3. 修改target, 在项目目录下执行

git config --local remote.origin.push refs/heads/*:refs/for/*

4. 对于高版本git, 会遇到 fatal: ssh variant 'simple' does not support setting port 这样的错误, 需要在项目目录下执行

git config --local ssh.variant ssh

  

猜你喜欢

转载自www.cnblogs.com/milton/p/12576792.html