My main dev project is a "total conversion" of a game named NAEV. My TC is named SoC (short for "Stars of Call"), which is set in a totally different universe from NAEV, but uses the game source as-is. With my limited C abilities, I sometimes lend a hand to NAEV. It's written in C and basically has two subfolders : src (C source) and dat (XML/Lua data).
NAEV is stored on GitHub, in its repository named naev/naev, which I do not own. I have my own clone Mutos/naev on GitHub, which I keep in synch with naev/naev. For that, I use a local repository with origin pointing to Mutos/naev and upstream to naev/naev, like in https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/syncing-a-fork.
So I develop SoC by trying to keep up the source with NAEV and focusing on the data, which describes the SoC universe. So the issue is, that SoC must have the same src folder than NAEV, but a totally different dat folder.
For now, I synch by hand my SoC src folder with NAEV src folder. But that means I lose commits history and cannot gradually adapt my data according to the evolution of NAEV, commit by commit. So SoC is always trailing behind NAEV and each time I want to update SoC's src, I have a hard time adapting my data.
What I want is setting up a third repository for SoC, named Mutos/SoC, whose src folder would follow NAEV src, while its dat folder would be totally independant from NAEV's dat folder.
How can that be achieved ? Note that I'm not so skilled in GitHub, because I use it only occasionnally. So I'll need explanations to be worded for being understandable n00b-level ^-^
Thanks for any hint !
This may not be what you're looking for, but you can consider:
Go into an initialized git repo where you would want to store the other repos. Then, inside the same directory, use:
git submodule add <repo url>
For example,
git submodule add https://github.com/rust-lang/rust.git
You can find the repo url by going to the repo's main page and clicking "clone or download," then copy the link.
If these are not already git repos, then you cannot add these directories to the same git repo. Every directory you include needs to be a subdirectory of the git initialized directory. If they were, then you can use:
git add <directory path>
For example,
git add ./subdirectory1/subdirectory2