This document describes how to use gerrit2.4.2 to set the approval process.
First, Gerrit already has two accounts, one being my account, an administrator, and the other being an engineer.
This article describes a simple approval process:
Submitted by engineerCode, I review and submit the code.
Step 1: Create a reviewer group and a Verifier Group
Reviewer is responsible for review
Verifier submits review results to the GIT central repository
Then set the members. Because I am the administrator, I will naturally be in both the reviewer and verifier groups.
Step 2: Create a project team. For example, here is the appengine team, which includes engineers.
Step 3: Set review and verifier permissions. For the sake of simplicity, Gerrit is used to set the following parameters in all projects access:
Csdn cannot upload images today. It is simply described as follows:
In the refs/* path, add the reviewer group. The permission is label code-Review and the range is-2 ~ + 2
In the refs/* path, add the Verifier Group. The permission is label verifier and the range is-1 ~ + 1
Step 4: Set access permissions for the project to be managed.
Add the appengine team group to the refs/For/* path. The permission is push.
Explain that every time an engineer pushes the ref/heades/Master directly to the central warehouse through git push, it will fail. Push to ref/For/master only, waiting for approval.
After the server is configured, set the client.
Step 5: Set the push shortcut
Each Command: git push origin head: refs/For/master is prone to errors. Therefore, add a configuration section in the. Git/config file in the project directory cloned from the client:
[Remote "Review"] pushurl = SSH: // wangxd555@10.112.18.189: 29418/appengine. Git push = head: refs/For/master pull epack = git receive-pack -- reviewer csfreebird
In this way, you can use git push review to push.
Step 6: To prevent a change from being called back and modified and then submitted as a new change, use the hook script provided by Gerrit.
SCP-P 29418-P username @ gerrit_server:/hooks/commit-MSG. Git/hooks
It works normally now.