Reputation: 29
We have multiple GIT repos and have requirement of including one subdirectory from different repo while cloning the main GIT repo. Example: When I clone repo_1 it also should clone repo_2:/src/dev So, only one clone command will be executed "git clone -b master repo_1." and it also should clone repo_2:/src/dev directory at the same time.
Is this possible to do in GIT?
Upvotes: 2
Views: 58
Reputation: 1323125
It is through submodules, where repo1
can reference a specific commit of repo2
, which will be checked out as a subdirectory of repo1
.
Using a script like Reedbeta/git-partial-submodule
can help making sure repo2 is using a sparse checkout, in order to deliver only its src/dev
content instead of the full repository.
What is not possible, as far as I know, is to have both repositories checked out in the same local folder.
Upvotes: 1