Ayoub Boutebal
Ayoub Boutebal

Reputation: 1

How to manage access to folders within a GIT repo

We are working in a Team on a software using a GIT repo. lately we will add external developers with us, the problem is that we dont want to share some data folders with them since they are confidentiel to the company.

Is there a way to manage access of some folders inside the GIT repo ?

Thank you for your responses.

Upvotes: 0

Views: 112

Answers (1)

bk2204
bk2204

Reputation: 76409

No, there is no secure way to share only parts of a repository in Git. The Git documentation describes this in the gitnamespaces(7) manual page, which talks about restricting refs using that feature:

The fetch and push protocols are not designed to prevent one side from stealing data from the other repository that was not intended to be shared. If you have private data that you need to protect from a malicious peer, your best option is to store it in another repository. This applies to both clients and servers. In particular, namespaces on a server are not effective for read access control; you should only grant read access to a namespace to clients that you would trust with read access to the entire repository.

All of this applies to repositories that don't use namespaces as well (which is the case for GitHub). If you need to restrict access to some data, it must live in a separate repository. GitHub uses a modified version of upstream Git on the server side, and thus all of these limitations apply there as well. I'm not aware of any implementation that offers different guarantees.

Upvotes: 1

Related Questions