Would it be possible to restrict developers not to create a branch in gitlab? Only Owner or Maintainer should create.
Any help would be appreciated.
Would it be possible to restrict developers not to create a branch in gitlab? Only Owner or Maintainer should create.
Any help would be appreciated.
You should be able to using protected branches.
Go to Settings
-> Repository
, and navigate to Protected Branches
.
You can then create a wildcard to protect all branches, and only allow Maintainers or Owners to push/merge.
After a lot of internet searching, I don't think you can stop specific users from creating new branches. Although, most of the suggestions given to accomplish some sort of control is to use protected branches.
Most suggestions along this route tell you to restrict branch creation for individuals with the "Developer" role, while allowing those with "Maintainer" role to continue creating branches on GitLab.
But, my use case desires the ability to restrict only some of the users with "Developer" access. My team is quite large, and I only want to restrict a small percentage of them from creating branches. I don't want to have to make the majority of my developers into "Maintainers" just to accomplish this restriction. Thus, I believe that restricting branch creation by individual user is not possible with GitLab at this time.