I have a single project and I want to pull two more repositories from my server into it. I’m getting a problem where one of the submodules is pulling in code from both repositories, though.
One submodule needs to be within
/projectroot/application/models
The other
/projectroot/library/NameSpace
This is what I do:
cd projectroot
git submodule add ssh://user@xx.xx.xxx.xx:/var/repositories/models.git application/models
This works wonderfully; my application/models contains what it needs to. So I move onto the next:
git submodule add ssh://user@xx.xx.xxx.xx:/var/repositories/NameSpace.git library/NameSpace
I take a look in
/projectroot/library/NameSpace
and I have ALL files from both repositories in there.
I should probably also note that
git submodule
correctly lists both submodules added as expected.
Am I missing something crucial here? Is it something I have done wrong with initializing the individual repositories? I have attempted this process ~3 times now.
Thanks.
Not sure if this can be considered an answer, but I managed to fix it by re-cloning the entire project (before I had added the submodules). I then tried to add the submodules in again and it worked.
Somewhere along the line Git/ something else was getting confused.
Thanks anyway.