LDAP + redmine + gerrit + jenkins + gitlab -- 添加已有git仓库到gerrit
来源:互联网 发布:免费钢材销售软件 编辑:程序博客网 时间:2024/06/07 05:34
环境
gerrit上已有两个账号, shuhm和temp, 其中shuhm为管理员
testgerrit为本地git仓库
配置gerrit发送邮件
编辑gerrit_site/etc/gerrit.config
, 其中gerrit_site为gerrit的安装目录
[sendemail] smtpServer = smtp.263.net smtpServerPort = 587 #smtpEncryption = ssl smtpUser = shuhm@r7data.com smtpPass = xxxxxx sslVerify = false from=CodeReview<gerrit@r7data.com>
创建Project
先通过gerrit web 创建Project, test
添加本地git仓库
通过管理员账号将已有git仓库推到gerrit
→ testgerrit (master) git push -u ssh://shuhm@172.16.6.220:29418/test.git master
clone gerrit 仓库
普通账号将仓库从gerrit clone到本地
→ git clone ssh://temp@172.16.6.220:29418/test.git
→ test (master) ls
README.md
修改README.md, 并commit
→ test (master) echo "world" >> README.md→ test (master) git add README.md→ test (master) git commit -m "add world"[master 580bc0e] add world Committer: Kylin <kylin@localhost.localdomain>Your name and email address were configured automatically basedon your username and hostname. Please check that they are accurate.You can suppress this message by setting them explicitly. Run thefollowing command and follow the instructions in your editor to edityour configuration file: git config --global --editAfter doing this, you may fix the identity used for this commit with: git commit --amend --reset-author 1 file changed, 1 insertion(+)
push到gerrit
→ test (master) git push ssh://temp@172.16.6.220:29418/test.gitCounting objects: 3, done.Writing objects: 100% (3/3), 261 bytes | 261.00 KiB/s, done.Total 3 (delta 0), reused 0 (delta 0)remote: Branch refs/heads/master:remote: You are not allowed to perform this operation.remote: To push into this reference you need 'Push' rights.remote: User: tempremote: Please read the documentation and contact an administratorremote: if you feel the configuration is incorrectremote: Processing changes: refs: 1, done To ssh://172.16.6.220:29418/test.git ! [remote rejected] master -> master (prohibited by Gerrit: ref update access denied)error: failed to push some refs to 'ssh://temp@172.16.6.220:29418/test.git'
配置remote.origin.push
, 再次push
→ test (master) git config remote.origin.push refs/heads/*:refs/for/*→ test (master) git push ssh://temp@172.16.6.220:29418/test.git HEAD:refs/for/masterCounting objects: 3, done.Writing objects: 100% (3/3), 261 bytes | 261.00 KiB/s, done.Total 3 (delta 0), reused 0 (delta 0)remote: Processing changes: refs: 1, done remote: remote: ERROR: In commit 580bc0ebae7f7e752b25e9c7ba0b405c37897d61remote: ERROR: committer email address kylin@localhost.localdomainremote: ERROR: does not match your user account.remote: ERROR:remote: ERROR: You have not registered any email addresses.remote: ERROR:remote: ERROR: To register an email address, please visit:remote: ERROR: http://172.16.6.220:9080/#/settings/contactremote: remote: To ssh://172.16.6.220:29418/test.git ! [remote rejected] HEAD -> refs/for/master (invalid committer)error: failed to push some refs to 'ssh://temp@172.16.6.220:29418/test.git'
配置Email, 再次push
登录gerrit web -> Settings -> Contact Information -> Register New Email … 然后登录邮箱进行验证
→ test (master) git config user.email 84567012@qq.com→ test (master) git push Counting objects: 3, done.Writing objects: 100% (3/3), 261 bytes | 261.00 KiB/s, done.Total 3 (delta 0), reused 0 (delta 0)remote: Processing changes: refs: 1, done remote: remote: ERROR: In commit 580bc0ebae7f7e752b25e9c7ba0b405c37897d61remote: ERROR: committer email address kylin@localhost.localdomainremote: ERROR: does not match your user account.remote: ERROR:remote: ERROR: The following addresses are currently registered:remote: ERROR: 84567012@qq.comremote: ERROR:remote: ERROR: To register an email address, please visit:remote: ERROR: http://172.16.6.220:9080/#/settings/contactremote: remote: To ssh://172.16.6.220:29418/test.git ! [remote rejected] master -> refs/for/master (invalid committer)error: failed to push some refs to 'ssh://temp@172.16.6.220:29418/test.git'
更正comment, 再次push
→ test (master) git logcommit 580bc0ebae7f7e752b25e9c7ba0b405c37897d61 (HEAD -> master)Author: Kylin <kylin@localhost.localdomain>Date: Thu Dec 7 21:15:31 2017 +0800 add world→ test (master) git commit --amend→ test (master) git push Counting objects: 3, done.Writing objects: 100% (3/3), 281 bytes | 281.00 KiB/s, done.Total 3 (delta 0), reused 0 (delta 0)remote: Processing changes: refs: 1, done remote: ERROR: [f7916cd] missing Change-Id in commit message footerremote: remote: Hint: To automatically insert Change-Id, install the hook:remote: gitdir=$(git rev-parse --git-dir); scp -p -P 29418 temp@172.16.6.220:hooks/commit-msg ${gitdir}/hooks/remote: And then amend the commit:remote: git commit --amendremote: To ssh://172.16.6.220:29418/test.git ! [remote rejected] master -> refs/for/master ([f7916cd] missing Change-Id in commit message footer)error: failed to push some refs to 'ssh://temp@172.16.6.220:29418/test.git'
添加hook, 再次push
→ test (master) gitdir=$(git rev-parse --git-dir); scp -p -P 29418 temp@172.16.6.220:hooks/commit-msg ${gitdir}/hooks/commit-msg 100% 4693 3.1MB/s 00:00→ test (master) git commit --amend[master df26fa4] add world Author: Kylin <kylin@localhost.localdomain> Date: Thu Dec 7 21:15:31 2017 +0800 1 file changed, 1 insertion(+)→ test (master) git push Counting objects: 3, done.Writing objects: 100% (3/3), 320 bytes | 320.00 KiB/s, done.Total 3 (delta 0), reused 0 (delta 0)remote: Processing changes: new: 1, refs: 1, done remote: remote: New Changes:remote: http://172.16.6.220:9080/1 add worldremote: To ssh://172.16.6.220:29418/test.git * [new branch] master -> refs/for/master
阅读全文
0 0
- LDAP + redmine + gerrit + jenkins + gitlab -- 添加已有git仓库到gerrit
- LDAP + redmine + gerrit + jenkins + gitlab -- LDAP配置
- LDAP + redmine + gerrit + jenkins + gitlab -- 使用LAM(LDAP Account Manager)管理用户
- 团队开发利器Redmine,git,gerrit,jenkins
- 【Gerrit】添加git工程到gerrit服务器
- 软件项目管理平台:repo+gerrit+jenkins+gitlab+sonar+redmine
- gitlab,gerrit,readmin,wordpress,jenkins
- Jenkins + Gerrit + Git
- Gerrit 添加一个已经有的git工程到gerrit服务器
- Gerrit 添加一个已经有的git工程到gerrit服务器
- GitLab项目迁移到Gerrit
- GitLab项目迁移到Gerrit
- Git+gerrit+jenkins安装配置
- gitlab+gerrit+jenkins持续集成框架
- CI 系统搭建Jenkins+GitLab+Gerrit
- Gerrit服务器的搭建(Git+Gerrit+PostgreSQL+LDAP)
- 在gerrit的git仓库中将仓库的所有版本提交到远程github仓库中
- Git、Gerrit与Jenkins/Hudson CI服务器
- LintCode之39 恢复旋转排序数组
- 如何使用vps
- PAT1068
- Entity Framework
- 【almost技术宅拯救世界】教你删除Windows.old文件夹
- LDAP + redmine + gerrit + jenkins + gitlab -- 添加已有git仓库到gerrit
- 洛谷P2073 送花_Treap
- Hadoop笔试题一答案
- 内容超过div的长度后自动出现滚动条的实现方法
- 关于价格的折扣的css
- 英雄的旅程-三段式
- 用有参构造函数作默认构造函数
- 金海佳学C++primer 练习9.31
- 【java基础】va synchronized关键字的用法(转载)