The GitLab security model is described in the section "Saving Secure Code ."
It includes branch protection (as shown by this commit )
A protected branch does three simple things:
- it prevents repulsion from everyone except users with wizard privileges.
- he doesn’t allow anyone to force the branch
- it does not allow anyone to delete a branch
You can make any branch a protected branch.
We make the master branch a secure default branch , but you can disable it.
Please note that this applies to reading / writing, not “visible / invisible”: you can still clone a complete repo and read access to everything.
Of course, OP tbo adds in the comments :
I need to find a way to limit visibility for a specific branch to specific users
This does not work Git repo: if you have access to it, you can see all its content (via a clone).
If you have content that should be invisible, then export it to your own Git repository (which you can protect against access).
The first main repo can refer to the second more closed Git repo as a submodule .
You can protect the branch from writing (but not against reading)
You can protect the repo from reading (via commands).
source share