Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Property to prevent gitlab from protecting default branches

Tags:

With version 7.4 gitlab changed the behaviour of protected branches in new projects.

In every new project the default branch e.g. master is a protected branch, meaning developers are not able to push to it. In my company a lot of developers work on the default/master branch and are now struggeling when starting a new project.

My Question: Is there a property in the ui or in the gitlab.rb to restore the pre 7.4 behaviour and to not protect the default branch?

like image 950
mniehoff Avatar asked Nov 14 '14 14:11

mniehoff


People also ask

How do I make branches protected in GitLab?

On the left sidebar, select Settings > Repository. Expand Protected branches. From the Branch dropdown list, select the branch you want to protect. From the Allowed to merge list, select a role, or group that can merge into this branch.

What does Protected branch mean in GitLab?

A protected branch does three simple things: it prevents pushes from everybody except users with Maintainer permission. it prevents anyone from force pushing to the branch. it prevents anyone from deleting the branch.

How do I unprotect a master branch in GitHub?

Deleting a branch protection rule On GitHub.com, navigate to the main page of the repository. Under your repository name, click Settings. In the "Code and automation" section of the sidebar, click Branches. To the right of the branch protection rule you want to delete, click Delete.


2 Answers

I'm not Sure if the is a default param, but per project you can change master as unprotected , in your project, go to settings -> protected branches and unprotect master enter image description here

Update

The gilt team published a post related to your question!! https://about.gitlab.com/2014/11/26/keeping-your-code-protected/

like image 178
rderoldan1 Avatar answered Sep 20 '22 22:09

rderoldan1


I'm not sure what version the feature was added, but in version 8.9.4 you can now select to allow Developers to Push to a protected project.

Also, you now have to click the gear widget dropdown in the upper right to get to the "Protected Branches" options in your project. (See below)Git Screen Shot

like image 38
Trashman Avatar answered Sep 21 '22 22:09

Trashman