In GitLab few branches can be preserved. By default just Maintainer/Owner users can promise to protected branches .
master branch is preserved by default - it forces developers to issue merge requests to be affirmed by project maintainers prior integrating them into main code.
You can turn on and off protection on chosen branches in Project Settings (where nicely relies on GitLab version - view instructions below).
On the similar settings page you can also approve developers to shock into the protected branches. With this setting on, protection will be limited to refusing operations claiming
git push --force (rebase etc.)
Whereas GitLab 9.3
Go to project: "Settings" → "Repository" → "Expand" on "Protected branches"
Currently, you can choose who is approved to merge or push into chosen branches (for example: you can turn off pushes to
master at all, forcing all alters to branch to be made through Merge Requests). Or you can click "Unprotect" to fully remove protection from branch.
Whereas GitLab 9.0
Likewise to GitLab 9.3, however no require to click "Expand" - everything is meanwhile expanded:
Go to project: "Settings" → "Repository" → scroll down to "Protected branches".
Pre GitLab 9.0
Project: "Settings" → "Protected branches" (in case you are at least 'Master' of given project).
Whereas GitLab Enterprise Edition 9.3.0
1-Choose you "project"
4-Choose "Project Settings"
5-In "Protected Branches" click to "expand"
6-and after click in "unprotect" button
That imply there is no
master branch to protect yet, since the empty repo does not has one.
To "Enable/disable branch protection", you require to be Master or Owner of the GitLab project .
Your first push is a
git push -u origin master;
The remote root does reference the right repo (
git remote -v);
Your local ssh key is the right one (
ssh -T firstname.lastname@example.org);
You are a member of the