gitblit-org / gitblit

pure java git solution
http://gitblit.com
Apache License 2.0
2.28k stars 670 forks source link

push to master restriction #1311

Open Symous opened 5 years ago

Symous commented 5 years ago

Awesome lib! Is there any way that we can configure a branch to restricting push to master branch, such as "protected branch" features? I just want to allow a few users to push or merge to master branch.

flaix commented 5 years ago

No, unfortunately branch protection is not yet implemented, but certainly high on the Wanted list.

Symous commented 5 years ago

@fzs thanks for the reply. I am looking forward to this feature. :)

chirontt commented 5 years ago

I think what @Symous needs is already available in the form of a pre-receive hook script.

The existing hook script protect-refs.groovy (in data/groovy folder) does similar thing for preventing push to master. It just need to be modified slightly to do what @Symous wants.

Symous commented 5 years ago

@chirontt Thanks friend, I have check protect-refs.groovy and seems like that it can truly achieve my requirement(not test yet). It will be much better if we can configure that on Gitblit page.

chirontt commented 5 years ago

Another option is to use the Gitblit plugin tbacl (Team-Branch ACLs) available at the Gitblit Registry. The plugin's source code is here, which was developed by James.