问题描述
我正在配置 Gerrit
,我想避免写下:
I am configuring Gerrit
and I would like to avoid writing:
git push gerrit HEAD:refs/for/master
我想写:
git push review
我确信可以修改 .git / config
,但我无法完成它。
I am sure it's possible modifying .git/config
but I can't make it work.
推荐答案
我设置了两种不同的推送类型,评论和noreview:
I set up two different push types, review and noreview:
用于评论:
for reviews:
git config remote.review.pushurl ssh://<GERRIT_HOST>:29418/<PROJECT_PATH>.git
git config remote.review.push refs/heads/*:refs/for/*
git push review # this will push your current branch up for review
旁路审查:
to bypass review:
git config remote.noreview.pushurl ssh://<GERRIT_HOST>:29418/<PROJECT_PATH>.git
git config remote.noreview.push refs/heads/*
git push noreview # this will push your current branch up, bypassing review
请注意,有一些Gerrit项目需要更改由项目业主/ Gerrit管理员制作,以绕过审查。我认为需要将Push权限添加到项目的refs / *中(除非您具体说明允许绕过审核的分支)。但是,对于评论,需要发布的权限已经设置完毕。换句话说,如果你的
Note that there are some Gerrit Project changes that need to be made by the Project Owner/Gerrit Admin in order to bypass a review as well. I think the "Push" permission will need to be added to the project for refs/* (unless you're getting specific about what branch you'll allow bypassing the review in). However, for reviews, the permissions needed to post in will already be set up. In other words, if your
git push gerrit HEAD:refs/for/master
正在工作,而不是上面的review部分也应该可以工作,而不需要改变别的。
is working, than the "review" part above should work as well without changing anything else.
这篇关于HEAD的git别名:refs / for / master的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!