I have tried a lot of different answers on stack but none of them work. I am trying to add a repository as a submodule which contains another submodule. So what I do is this:
git submodule add -b develop [email protected]:submoduleRepo The submodule is added to the repository and contains the folder of the submodule within it. However the folder is empty. So I follow up with this command:
git submodule update --init --recursive Which returns me nothing. If I go to the directory of the submodule cd submoduleRepo and then type git submodule, I get:
fatal: no submodule mapping found in .gitmodules for path 'src/app/nestedSubmoduleRepo' This is my .gitmodules of the main repo:
[submodule "submoduleRepo"] path = submoduleRepo url = [email protected]:submoduleRepo.git branch = develop And within submoduleRepo/.gitmodules:
[submodule ".\\src\\app\\nestedSubmoduleRepo"] path = .\\src\\app\\nestedSubmoduleRepo url = [email protected]:nestedSubmoduleRepo.git Why do I keep getting this error and is the directory not getting populated?
EDIT:
Once I've ran --init --recursive once it gives me the error:
fatal: No url found for submodule path 'submoduleRepo/src/app/nestedSubmoduleRepo' in .gitmodules Failed to recurse into submodule path 'submoduleRepo' My git config:
[core] repositoryformatversion = 0 filemode = false bare = false logallrefupdates = true symlinks = false ignorecase = true [remote "origin"] url = [email protected]:mainRepo.git fetch = +refs/heads/*:refs/remotes/origin/* [branch "master"] remote = origin merge = refs/heads/master [submodule "submoduleRepo"] url = [email protected]:submoduleRepo.git active = true
https://github.com/user/repo.git