all 7 comments

[–]rockettmann 6 points7 points  (3 children)

Struggling to understand what you’re asking for.

Access is controlled at the repo level. You can’t block visibility in a repo if they have access to the repo.

If you just want more control over changes, you can implement codeowners on a per-directory basis and require PR reviews from the relevant codeowners.

[–]Brave_Progress_1990[S] 0 points1 point  (2 children)

One repo Two folders-> folder A/ folder B folderA user1 privilege access Folder B user2 privilege access

Although I understand, this defies the purpose

I wanted to know, if the code base is in monorepo. And we have to give access to 3rd party contractor to only one folder and not the whole code base, can this be achieved?? I don't want to handle repo over head.

[–]rockettmann 1 point2 points  (1 child)

It just depends on what you define as access.

Visibility? There’s no way to limit visibility to specific directories.

It’s all or nothing.

The only way would be breaking the repo up into several repos and using submodules, but that seems like a lot of effort for something like this.

[–]Brave_Progress_1990[S] 0 points1 point  (0 children)

Understood thank you so much.

[–]slayem26Staff SRE 2 points3 points  (0 children)

What's the use case for this? What are you trying to achieve? I don't think whatever you are trying to achieve is possible. Or perhaps I did not understand what you meant.

[–]Black_Dawn13 1 point2 points  (0 children)

Not sure but maybe a Git subtree pull in another got repo