我正在尝试设置gerrit代码审查服务器。我安装了gerrit服务器,我可以在我的本地主机localhost:8080
上访问它
我还安装了gerrit git review
。
在提交文件更改后,当我git push origin master
时,我得到了这个
dev> git push origin master
Counting objects: 17, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 621 bytes | 0 bytes/s, done.
Total 6 (delta 3), reused 0 (delta 0)
remote: Resolving deltas: 100% (3/3)
remote: Processing changes: refs: 1, done
To ssh://newbie@localhost:29418/dev.git
ac19936..de7d7ea master -> master
当我git review
时,我得到了这个
dev> git review
remote: Resolving deltas: 100% (1/1)
remote: Processing changes: new: 1, refs: 1, done
remote:
remote: New Changes:
remote: http://localhost:8080/6 this is a check on gerrit code review with git review
remote:
To ssh://newbie@localhost:29418/dev.git
* [new branch] HEAD -> refs/publish/master
只有当我执行git review
时,我才能获得localhost上代码审核的链接http://localhost:8080/6
。
即使我做git push
,我也想获得代码审查链接。我怎么能得到它?任何人都可以帮助我
答案 0 :(得分:0)
git push gerrit HEAD:refs/publish/master
这解决了我的问题。
我在运行git review -v
时得到了这个解决方案。这显示了在审查过程中运行的所有命令。
dev> git review -v
2015-05-26 12:59:32.789433 Running: git log --color=never --oneline HEAD^1..HEAD
2015-05-26 12:59:32.794065 Running: git remote
2015-05-26 12:59:32.797142 Running: git branch -a --color=never
2015-05-26 12:59:32.800575 Running: git rev-parse --show-toplevel --git-dir
2015-05-26 12:59:32.803797 Running: git remote update gerrit
Fetching gerrit
2015-05-26 12:59:32.870035 Running: git rev-parse HEAD
2015-05-26 12:59:32.873419 Running: git show-ref --quiet --verify refs/remotes/gerrit/master
2015-05-26 12:59:32.876519 Running: git rebase -p -i remotes/gerrit/master
2015-05-26 12:59:33.637414 Running: git reset --hard 5e0c601b83d598a52c8234d4ef4213acce824dea
2015-05-26 12:59:33.745906 Running: git config --get color.ui
2015-05-26 12:59:33.749583 Running: git log --color=always --decorate --oneline HEAD --not --remotes=gerrit
2015-05-26 12:59:33.754085 Running: git branch --color=never
2015-05-26 12:59:33.757454 Running: git log HEAD^1..HEAD
Using local branch name "master" for the topic of the change submitted
2015-05-26 12:59:33.766298 Running: git push gerrit HEAD:refs/publish/master
remote: Resolving deltas: 100% (2/2)
remote: Processing changes: new: 1, refs: 1, done
remote:
remote: New Changes:
remote: http://localhost:8080/7 another checking for checking git review
remote:
To ssh://newbie@localhost:29418/dev.git
* [new branch] HEAD -> refs/publish/master
2015-05-26 12:59:34.139211 Running: git rev-parse --show-toplevel --git-dir