scp -P 29418 baiyunheng@192.168.1.203:hooks/commit-msg .git/hooks/ git commit --amend ? git pull命令 git pull 拉去最新的程序 2.3.4 在gerrit设定审批人员 ? 登录gerrit http://192.168.1.203/ ? 设定review人员 My----》Changes 后选择你需要review的文件单击 添加人员账号(例如:admin)点击Add Reviewer 2.3.5 Gerrit审核通过或拒绝 ? 在选择-2表示拒绝 ? 在选择+2表示通过 2.3.6 拒绝处理 ? 对源文件修改 ? 再提交 ? git add 1.txt ? git commit 1.txt --amend ##一定要用amend ,为保证 ? 然后进行push ? git push origin master:refs/for/master 说明:一直到review通过为止,或者放弃本次修改 3 JENKINS项目构建及部署 访问地址:http://192.168.1.203:8081/jenkins/(如果要增加用户需要请联系管理员或者自己进行注册) 使用的方法请参考例子: 4 其他小技巧 4.1 .GITIGNORE ? 作用:忽略不需要提交的文件或文件夹 ? 具体方法如下: gitconfig --global core.excludesfile ~/.gitignore ##指定.gitignore的位置 .gitignore内容可参考SVNsvn://192.168.1.203/project/doc/1.过程库/3.成果文档/1.版本管理/.gitignore 内容 # 忽略*.class *.class # 忽略 classes/ 目录下的所有文件 classes/ 4.2 自动添加REVIEWER A. 痛苦的做法: 1. git push origin HEAD:refs/for/master2. 在gerrit管理网站,每个 commit一个设置reviewer. B. 直接命令里面设置 git push origin HEAD:refs/for/master%r=fanxu.china@gmail.com 其中, %r 指定了code reviewer 但这么长的一串, 每次push都来上这么一次,也挺痛苦的。 C. 最舒适的做法 首先 ,配置一个远程分支,将所有的参数,都一次性配置好。 修改工程目录下的 .git/config 文件, 添加以下字段: [remote"review"] url = ssh://fanxu123@fanxu.com:29418/test push = HEAD:refs/for/master%r=fanxu.china@gmail.com 然后 ,以后每次推送直接用以下命令就可以啦, 完全无痛! gitpush review push = HEAD:refs/for/master%r=fanxu.china@gmail.com, r=other_man@lenovo.com |
|
来自: ala咪s > 《SCM_gerrit》