You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
How to define different users for different directory access.
In my repos containing a c++ solution, I want to make different users to have different projects which are in different directory.
Such as A, B two users, D1, D2, D3 three directory in my repos.
The A user only could read D1, D2 directory.
The B user only could read D2, D3 directory.
Hi @sysuwhb and welcome to the community!
Giving access to a certain directory only in a repo is something not supported natively by Git and we don't have such a feature available either. When a user gets granted access to a repository, they have access to the whole repo.
You may want to look into Git submodules instead and see if it's something that would work for you:
E.g. you could create three separate repos for each directory (D1, D2, D3) and then make these repos submodules to your main repo. This way, you could give access to users only to certain submodule repos.