1

I have one git repository with two folders, "backend" and "frontend". I want my subcontractors not to be able to read the "backend" folder which is confidential. My contractors may access to both.

Am I forced to do two repos ? Isn't there a git wrapper to delete confidential contents before their download ?

If I go multi-repos, could I use git bit for me to keep working as if I had only one repo ?

clouvis
  • 567
  • 1
  • 6
  • 18
  • 3
    *"Isn't there a git wrapper to delete confidential contents before their download ?"* If you really understand how Git works, you'll realize that this isn't possible. You need two repositories. – Jonathon Reinhart Aug 20 '19 at 10:45
  • Possible duplicate of [How to hide files and folders from Github public](https://stackoverflow.com/questions/33864292/how-to-hide-files-and-folders-from-github-public) – handlerFive Aug 20 '19 at 10:47
  • thanks @Rons, I edited my post: my contractors need to access to the two folders, so .gitignore is not a solution – clouvis Aug 20 '19 at 11:38
  • `.gitignore` is not a solution anyway; the answers at the linked page are bogus: "*Using the .gitignore file excludes files from being part of a push*" — that certainly not true. `.gitignore` excludes files from being part of commits; once a file is added to the repository `.gitignore` is not used to ignore it and files will be pushed despite `.gitignore`. Two separate repositories — one private and one for contractors — is the only solution. – phd Aug 20 '19 at 15:18
  • @phd thank you, so how can I use git bit for me to keep working as if I had only one repo ? – clouvis Aug 21 '19 at 09:51
  • 1
    [tag:git-subtree], I think. [Split a subdirectory](https://stackoverflow.com/a/17864475/7976758) and regularly pull/push to/from the private repository from/to the repo for subcontractors. – phd Aug 21 '19 at 10:42

0 Answers0