0

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

Tanmay Jain
  • 123
  • 1
  • 2
  • 12
  • Split your code to multiple repos, and then share only the ones you wanted with those developers. That's very common usage of GitHub private repos. – Lex Li Jun 16 '20 at 15:28
  • I want to do something different. Let suppose I have X repo, I split it to X1 and share.Now to run in machine one need X+X1 to run. How can I encrypt or protect that X? – Tanmay Jain Jun 16 '20 at 15:45

1 Answers1

0

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.

bk2204
  • 64,793
  • 6
  • 84
  • 100