How to collaborate on part of a repository

I am trying to understand some basics of GitHub related to collaboration and web pages. I have 5 repositories, 3 of which are intended to be web pages, and I plan to add a 6th. 3 of the repositories are closely related, and the other 3 are autonomous. That is, A subdivides into X, Y and Z, and then B and C are separate. As far as web pages are concerned, it would be ideal to have a uniform naming scheme:,,,, I can implement this by making repositories A, B and C, and within A creating subdirectories Z, Y, Z.
The collaboration desideratum is that I’d like to invite colleagues to collaborate selectively: Smith collaborates on A/X, Jones collaborates on A/Z, Doe collaborates on C. But from what I can tell, collaboration is possible for repositories but not specific sub-directories of a repository (I haven’t figured out how to do it, at any rate). Is this correct? The goal is to organize everything hierarchically by a well-established criterion, and make web access automatic and obvious via the above naming scheme. I want to avoid the “anybody can edit anything” approach.

Hi @LanguageDescriptions,

You are correct in that when you invite a collaborator to your repository, they have access to the entire repository. We do not have a feature that can hide specific parts or subsets of a repository from other collaborators.

We’re always working to improve GitHub and the GitHub Support Community, and we consider every suggestion we receive.
You can do so by submitting this through our official product feedback form so that our product team can track your request.

You can also keep an eye on our Changelog as well as the GitHub public roadmap to see features we are working on.