2

We have a git repository with N folders.

Repo
|-Folder1
|-Folder2
|- ...
|-FolderN

With different collaborators we would like to share a different subset of folders. Each collaborator should have access only to his allowed subset of folders. What is the "good" way to achieve this using git?

Issam T.
  • 1,677
  • 1
  • 14
  • 32
  • 1
    probably by making folder1, folder2, foldern seperate repos, I doubt there is a way otherwise. – AD7six Jun 27 '16 at 13:17
  • 4
    Possible duplicate of [Per-directory permissions on git](http://stackoverflow.com/questions/3139934/per-directory-permissions-on-git) – everton Jun 27 '16 at 13:17
  • @AD7six if we create separate repos, would it still be possible to pull them together, push them together, ..., without the need for writing customized scripts to do such tasks. – Issam T. Jun 27 '16 at 13:23

2 Answers2

0

You can try using groups/organizations on Gitlab/Github. I'm more familiar with Gitlab, but it will let you add people as "roles" (developer, observer) to certain subprojects in your repo.

janezdu
  • 48
  • 1
  • 8
0

Since you are explicitly disallowing developers write access to each other's folders, then I suggest you should be using a dependency package manager like composer or npm. Each developer would have their own repository. Then you have a super project that includes all developer's work as a project dependency.

Jeff Puckett
  • 37,464
  • 17
  • 118
  • 167