User access in only one branch of repository

Tell me, please, is it possible to organize such a repository structure. In the repository, in addition to the main master branch, there are dev, stack, and front branches. The entire project is in the master, dev, stack branches, and only design template files should be in the front branch. I need a person who is involved in front-end:

  • had access only to the front branch and did not have access to the master, dev, stack branches;
  • I was not able to clone the contents of the repository and its branches, except for the front branch;
  • except for the front branch, it could not receive files from the repository and send files there;
    Simply put, he had an isolated front branch from which I could get changes in his front branch and add them to other branches using merge or in another way.

Hi,

I don’t think that this works with Git, not even with protected branches added by GitLab. If users shouldn’t get access to specific code parts, I strongly recommend to create dedicated projects and control them through permission groups.

For creating the full product package, you can still use CI jobs from the administrative repository and e.g. build packages from many repos, or deploy them into staging or production environments.

Cheers,
Michael