Error while checking out git repository with submodules
I faced the same issue. Delete all submodules from their physical locations and try again:
git submodule update --init
The error has nothing to do with jenkins or bitbucket but a git misconfiguration. .git/config
is not tracked, but .gitmodules
is.
The path git@bitbucket.org:xxxx/xxx.git/sub2
should have made me notice the actual error, which was in .gitmodules
:
[submodule "sub1"] path = sub1 url = git@bitbucket.org:xxxx/sub1.git[submodule "sub2"] path = sub2 url = ./sub2
It worked locally because of the different local configuration that is not tracked by git. Basically in .gitmodules
, it should be only addresses.
I made the mistake when assembling the repository and using git submodule add sub2
on a local clone instead of checking it out entirely.