There are two complex projects and my newly created one, for the sake of simplicity all hosted on Github, say
https://github.com/vendor/asset/
,https://github.com/standard/metadata/
andhttps://github.com/me/mashup/
.
Within my project, I only need a single subtree from the first repository (i.e. a folder and all files in it), say ./assets/img/
, and a single file from the second one (each from their main branch), say ./data/names.json
. Both will be updated from time to time.
As far as I understand the documentation on the .gitmodules file and the git submodule command, there is no way to directly achieve this. That means the following (or something like it) won't work:
[submodule "assets"]
path = images/vendor
url = git://github.com/vendor/asset.git:/assets/img/
[submodule "metadata"]
path = standard-names.json
url = git://github.com/standard/metadata.git:/data/names.json
What is the best practice here? Can I put the submodules in a hidden folder and create symlinks in the places I want?
images/vendor -> .ext/vendor/assets/img/
standard-names.json -> .ext/standard/data/names.json