I have a private repo on Github, Repo A. The structure of the project in Repo A is like:
dist/
src/
project-file.js
project-file2.js
I want to make available the src/
directory in a (new) public repo on Github.
Ideally, I would like this to be as automatic as possible. So in the event that I update source files in Repo A, I would like the public repo to be easily updated, too.
I've found a couple of solutions: the first one involves using Github releases and submodules. This one seems to keep the two repos connected but I'm unsure how to push the src/
directory into(?) the submodule and then push that to a fresh, public remote repository.
The other solution I found is using filter-branch
on a cloned repo. The only problem with using the latter that I can foresee is that the two branches then become detached and any changes I make to Repo A will have to be re-cloned again and pushed anew to the public repo.
Basically, I have a private project but I want to make some of the files public for viewing. I believe the first option, using submodules is the better choice, but I'm not sure how to do this in practice. I am not too well-versed with advanced Git techniques so apologies if I'm missing something.