Let me first describe the problem. Assume that I have the following directories structure:
Repo-A
- ...
- sub-dir-A
- ...
Repo-B
- ...
- sub-dir-B
- ...
Repo-C
- ...
- sub-dir-C
- ...
...
What I want to do is the following: I want to make Repo-A
, Repo-B
, and also Repo-C
all private, which contains all and sub-dir-A
, sub-dir-B
and sub-dir-C
's contents, while making sub-dir-A
, sub-dir-B
and sub-dir-C
into another public repo. i.e.,
Repo-A
- ...
- sub-dir-A
- ...
Repo-B
- ...
- sub-dir-B
- ...
Repo-C
- ...
- sub-dir-C
- ...
Repo-Public
- sub-dir-A
- sub-dir-B
- sub-dir-C
My approach now is rather naive, I just simply create another separate public repo and copy-pasting all the sub-dir-<A, B, C, ...>
into that new directory and manually update them, which is a pain.
I'm not sure whether this is doable, especially I'm familiar with working with sourcetree
but not the command line for git
. (But if the only option is using the command line to manipulate things around, then I can learn it for sure). I have looked into the symbolic link and things like submodule and subtree in git
, but can't find a useful tutorial. They're usually talking about how to split two directories, while I want to make them integrated somehow.