2

I'm trying to figure out what the cleanest way is to compose a public repository out of a subset of a private repository (or compose the private as a union with the public portion) and still have the shared files be updated in tandem. As an example, say I have these two files:

  • public_file
  • private_file

An end user should be able to pull only public_file, but maintainers should be able to modify both public_file and private_file. What git idiom would be suited to this kind of access control layout?

SaxSalute
  • 349
  • 2
  • 8
  • If you only want maintainers modify files in private repo, they can use `git remote add ` then commit&push changes. other end users only work for public repo. I'm not sure if it's your requirement. – Marina Liu Dec 21 '16 at 08:29

1 Answers1

1

For a single file, you would use a smudge content filter driver that would generate (automatically on git checkout) the private file out of an external value file and a versioned template file.

For a collection of files, you would use a git submodule, which would register the public files in a nested folder as a nested git repo of the main parent one: the private repo.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250