How to Manage Folder-Level Access in GitHub?

0
8
Asked By CuriousCat42 On

Hey everyone! I'm trying to get a better handle on GitHub's access management. Currently, it seems like GitHub only allows access control at the repository level, meaning there's no way to restrict access to specific folders. In large organizations, how do you typically manage this situation? Are there any effective strategies or tools you could recommend? I'm looking for alternatives to submodules—if we do end up using them, will we need to adjust our GitHub workflow? Thanks in advance for your insights!

2 Answers

Answered By TechWhiz99 On

You might want to think about your use case. If you're looking to give access to a third-party contractor for just one folder in a monorepo, that's tricky! I really don't think GitHub currently allows that level of granularity. Your best bet could be to explore using Git subtrees. Essentially, you could pull in another repo as a subtree for that specific folder, which might help keep the rest of the codebase private.

Answered By DevGuru86 On

I get where you're coming from! GitHub's permissions are set at the repo level, so if someone has access to the repo, they can see everything inside it. However, if you need more granular control, consider using CODEOWNERS files. This way, you can specify who needs to approve changes in certain directories when a pull request is created. It helps a bit in managing contributions without completely locking down folders.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.