How to hide some code part and run full in machine

233 Views Asked by At

I want to know whether the following thing can be achieved by Github Actions or other Github feature:

I have a repository having hundreds of file, I want to share only a few files by my developer/ team. (They can only able to saw those few files, I shared). The program can only run successfully if a developer has all those files(hidden and unhidden both). So, is there any way through which I can hide all my code from the team, and whenever they pull the repository, all those hidden files should be downloaded in an encrypted way, and rest unhidden files can be accessed by the developer and they can execute the whole repository successfully.

If it's not possible with Github, is there any alternative tool through which I can achieve this?

Thanks

1

There are 1 best solutions below

0
bk2204 On

Git does not provide access control to only parts of repositories, and it's not intended to. From gitnamespaces(7):

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.

So if you want to give a user access to only a few files, they need to live in another repository with separate access control (that is not a fork of the original). That will involve a separate history.

If the user needs the other files in order to develop the software, then you'll just have to give them access, or you'll have to provide pre-built binary assets they can download to build against.

In general, it's not practical to not trust your developers with full code access. Usually one protects this access with legal means, like non-disclosure agreements, not technical measures, since technical measures are usually easily bypassed.