Gerrit 使用
2016-02-23 13:38
267 查看
参考Gerrit的使用说明
ssh -p 29418 hwh@188.188.1.9 gerrit --help
可以查看每一个命令的说明:比如create-project
ssh -p 29418 hwh@188.188.1.9 gerrit create-project --help
1.创建项目(必须要有管理员权限)
ssh -p 29418 hwh@188.188.1.9 gerrit create-project -p All-Projects -n Art --empty-commit
可以在本机上使用: 29418 gerrit服务器端口,hwh是gerrit账号, 188.188.1.9 服务器地址
gerrit create-project 用gerrit来创建项目 -p All-Projects 权限从All-Projects继承 p是父项目
-n Art project名字是Art --empty-commit 项目创建时,加一个空提交。
2.删除gerrit用户
ssh -p 29418 zbb@review.mdaxue.com gerrit gsql
delete from ACCOUNT_EXTERNAL_IDS where external_id='username:zzy';
3、从git服务器获取代码
git clone http://188.188.1.9/Art
git clone ssh://hwh@188.188.1.9:29418/Art
git clone http://hwh@188.188.1.9/Art
4.创建http登录帐号
htpasswd -b ./review_site/etc/passwd hwh 123456
更新账户,htpasswd -b ./review_site/etc/passwd hwh 12345678
5.管理员创建邮箱
回到本机通过ssh远程连接创建邮箱
$ cat ~/.ssh/config
Host ha
HostName 192.168.1.99
User root
Port 29418
IdentityFile ~/.ssh/id_rsa
$ ssh ha gerrit set-account --add-email accountemail accountname
6、删除项目
到gerrit服务器里,直接删除该项目比如:test.git
重启gerrit服务器,进去看list,发现这个项目没有了。
7、push代码和tags
git push --tags origin HEAD:refs/heads/qmc-8974-la-4.0.2-ref
把从高通下载的代码和tag一起push到服务器,结果是代码可以push,tag不能。
自己新建一个git,加上代码和tag,push的服务器,结果是可以push。
查找权限,refs/heads/*已经有权限了,可以push code,所以我们要查找tag的权限,refs/tags/*的权限也都有了。所以我们自己的git可以push code和代码,但是为什么别人的code不能push tag呢?需要加Forge Author Identity和Forge Committer Identity
Forge Author
Normally Gerrit requires the author and the committer identity lines in a Git commit object (or tagger line in an annotated tag) to match one of the registered email addresses of the uploading user. This permission allows users to bypass parts of that validation, which may be necessary when mirroring changes from an upstream project.
Permits the use of an unverified author line in commit objects. This can be useful when applying patches received by email from 3rd parties, when cherry-picking changes written by others across branches, or when amending someone else’s commit to fix up a minor problem before submitting.
By default this is granted to Registered Users in all projects, but a site administrator may disable it if verified authorship is required.
Forge Committer
Normally Gerrit requires the author and the committer identity lines in a Git commit object (or tagger line in an annotated tag) to match one of the registered email addresses of the uploading user. This permission allows users to bypass parts of that validation, which may be necessary when mirroring changes from an upstream project.
Allows the use of an unverified committer line in commit objects, or an unverified tagger line in annotated tag objects. Typically this is only required when mirroring commits from an upstream project repository.
Forge Server
Normally Gerrit requires the author and the committer identity lines in a Git commit object (or tagger line in an annotated tag) to match one of the registered email addresses of the uploading user. This permission allows users to bypass parts of that validation, which may be necessary when mirroring changes from an upstream project.
Allows the use of the server’s own name and email on the committer line of a new commit object. This should only be necessary when force pushing a commit history which has been rewritten by git filter-branch and that contains merge commits previously created by this Gerrit Code Review server.
ssh -p 29418 hwh@188.188.1.9 gerrit --help
可以查看每一个命令的说明:比如create-project
ssh -p 29418 hwh@188.188.1.9 gerrit create-project --help
1.创建项目(必须要有管理员权限)
ssh -p 29418 hwh@188.188.1.9 gerrit create-project -p All-Projects -n Art --empty-commit
可以在本机上使用: 29418 gerrit服务器端口,hwh是gerrit账号, 188.188.1.9 服务器地址
gerrit create-project 用gerrit来创建项目 -p All-Projects 权限从All-Projects继承 p是父项目
-n Art project名字是Art --empty-commit 项目创建时,加一个空提交。
2.删除gerrit用户
ssh -p 29418 zbb@review.mdaxue.com gerrit gsql
delete from ACCOUNT_EXTERNAL_IDS where external_id='username:zzy';
3、从git服务器获取代码
git clone http://188.188.1.9/Art
git clone ssh://hwh@188.188.1.9:29418/Art
git clone http://hwh@188.188.1.9/Art
4.创建http登录帐号
htpasswd -b ./review_site/etc/passwd hwh 123456
更新账户,htpasswd -b ./review_site/etc/passwd hwh 12345678
5.管理员创建邮箱
回到本机通过ssh远程连接创建邮箱
$ cat ~/.ssh/config
Host ha
HostName 192.168.1.99
User root
Port 29418
IdentityFile ~/.ssh/id_rsa
$ ssh ha gerrit set-account --add-email accountemail accountname
6、删除项目
到gerrit服务器里,直接删除该项目比如:test.git
重启gerrit服务器,进去看list,发现这个项目没有了。
7、push代码和tags
git push --tags origin HEAD:refs/heads/qmc-8974-la-4.0.2-ref
把从高通下载的代码和tag一起push到服务器,结果是代码可以push,tag不能。
自己新建一个git,加上代码和tag,push的服务器,结果是可以push。
查找权限,refs/heads/*已经有权限了,可以push code,所以我们要查找tag的权限,refs/tags/*的权限也都有了。所以我们自己的git可以push code和代码,但是为什么别人的code不能push tag呢?需要加Forge Author Identity和Forge Committer Identity
Forge Author
Normally Gerrit requires the author and the committer identity lines in a Git commit object (or tagger line in an annotated tag) to match one of the registered email addresses of the uploading user. This permission allows users to bypass parts of that validation, which may be necessary when mirroring changes from an upstream project.
Permits the use of an unverified author line in commit objects. This can be useful when applying patches received by email from 3rd parties, when cherry-picking changes written by others across branches, or when amending someone else’s commit to fix up a minor problem before submitting.
By default this is granted to Registered Users in all projects, but a site administrator may disable it if verified authorship is required.
Forge Committer
Normally Gerrit requires the author and the committer identity lines in a Git commit object (or tagger line in an annotated tag) to match one of the registered email addresses of the uploading user. This permission allows users to bypass parts of that validation, which may be necessary when mirroring changes from an upstream project.
Allows the use of an unverified committer line in commit objects, or an unverified tagger line in annotated tag objects. Typically this is only required when mirroring commits from an upstream project repository.
Forge Server
Normally Gerrit requires the author and the committer identity lines in a Git commit object (or tagger line in an annotated tag) to match one of the registered email addresses of the uploading user. This permission allows users to bypass parts of that validation, which may be necessary when mirroring changes from an upstream project.
Allows the use of the server’s own name and email on the committer line of a new commit object. This should only be necessary when force pushing a commit history which has been rewritten by git filter-branch and that contains merge commits previously created by this Gerrit Code Review server.
相关文章推荐
- 真要救经济,就应该放掉房地产,减税
- Dsoframer注册方法
- JAVA操作Excel文件
- 心得2
- python 解析html标签中的属性
- iOS小明开发笔记(十二) (Quartz2D简单使用一)
- swift-集合类型01-数组的基本操作
- [LeetCode] Flatten 2D Vector 压平二维向量
- bzoj4198 荷马史诗
- 免费的在线Web文件管理器:Net2FTP,Pydio,eXtplorer,KodExplorer–功能强大
- SMC计算节点重刷系统步骤
- spring是怎么知道哪个方法或者类上有@requestMapping这个注解
- 关于xcode7 ios9的一些变化
- GitHub for Windows提交失败“failed to sync this branch”
- 51单片机状态机键盘检测
- 集合框架之小小总结
- React Native学习笔记-2:this.props.navigator undefined
- Unicode和UTF-8关系
- SMC管理节点升级步骤
- C#写的dll,C#中如何调用