How to make multiple developers work on different branches in the same repo but can't have access to each other branches?

Problem to solve

Describe your question in as much detail as possible:

So we want to create a project where every dev will clone the main branch to their respective branch inside the same project where let say:

Dev A works on feature branch feature/a and Dev B works on feature branch feature/b. They are only allow to push their code on the feature branch they have created inside the project. No one is allow
to gain access/read/write to other feature branch. The main branch is available for everyone to clone but not to push/merge.

Is that feasible on Gitlab?


Please select whether options apply, and add the version information.


GitLab Enterprise Edition v16.10.3-ee