问题
While working with Gerrit, the expected push
is:
git push origin HEAD:refs/for/branch
But some bad guys seems to do this in a simple way(they learned from some Git manual):
git push origin
or
git push
These operation will cause serious problems:
- The commit merged directly into master (or some default) branch in remote server.
- Although the guys write some commit message, but
git log
can'not find them. - Maybe more...
Is there was a way to disable these push
operation in Gerrit settings? Or disable it in client?
回答1:
There are permissions in the Gerrit admin UI. Permissions are inherited from the All-Projects
project. Have a look there (Admin => Project => All-Projects => Access) and remove the push right to anyone on master. More details in the doc here: Access control
来源:https://stackoverflow.com/questions/15654184/how-to-disable-direct-push-to-gerrit