gitaccess-controlmonorepo

Granular access to directories within monorepo


I've been reading about the advantages of monorepos, but haven't yet found a mitigation for the problem of sharing parts of a repo:

Let's say an organization has a monorepo for a client/server web application. They hire a contractor to work on the design of some part of the client. How can they give the contractor access to only the relevant client code? Even sparse checkouts are not trivial.


Solution

  • Consider using git subtree.

    With git subtree you will be able to:

    For a list of pros/cons check out Atlassian's Git subtree: the alternative to Git submodule. Though I think the example steps in this article are rather limited if not outdated.

    For step by step demonstrations with git log details at each step:

    If you want an under the covers understanding:

    monorepo-operator is a tool that may make managing your subtree-based monorepo easier. I haven't used it and cannot vouch for it, but might be worth checking out.