leeyuiwah leeyuiwah - 3 years ago 201
Git Question

Gerrit: Is there a way to push directly into master?

I understand that Gerrit impose a code review process so that every changes has to get a verification plus a code review of score "+2"

My question: Is there a way to bypass these two requirements? We need to do this for debugging purposes

Answer Source

You push changes to Gerrit executing the "git push" command like in the following example:

git push origin HEAD:refs/for/master

The "refs/for" is the "magical branch" which tells Gerrit that you want to send a change to review.

You can bypass Gerrit (and the review process) pushing straight to the branch if you execute the "git push" command like following:

git push origin HEAD:refs/heads/master

or simply:

git push origin HEAD:master

or considering that your local branch master tracks the remote branch master, just:

git push

But... to be able to push straight to the branch bypassing Gerrit you need to have Push = ALLOW permission for refs/heads/* reference.

Gerrit administrators can grant this permission to you. It's not mandatory but usually only users with "integrator" role have this permission set.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download