I have two git repositories with a few shared subdirectories between them, as shown below.
Repo 1 Repo 2
|-Folder A |-Folder A
| |-docA.c | |-docX.c
|-Folder B |-Folder B
| |-docB.c | |-docY.c
|-Folder C |-Folder D
| |-docC.c | |-docZ.c
Now, I am trying to create a third repository that joins repo 2 into repo 1, in a GNU stow like manner. However, I would like to have the documents imported form repo 2 recognised as belonging to that repository, emulating the behaviour of git submodule. As far as I could figure out, submodule only lets me add an entire subfolder to my project form another repository. Just for reference, the third repository should have the following structure:
Repo 3
|-Folder A
| |-docA.c
| |-docX.c
|-Folder B
| |-docB.c
| |-docY.c
|-Folder C
| |-docC.c
|-Folder D
| |-docZ.c
Is this even possible to achieve? Or am I better off just keeping the two repositories separate, track their changes separately and using GNU stow when needed?