Reputation: 359
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:
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?
Upvotes: 2
Views: 45
Reputation: 1324278
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.
Upvotes: 1