We have a weird issue with our git repository. We reference two submodules (not sure if it matters: the one that makes troubles lies on bitbucket cloud while the repo and the other submodule lie on the same bitbucket server instance)
If someone wants to freshly check out the repository, they get the following error:
Cloning into local/path…
Warning: Permanently added the RSA host key for IP address
xx.xxx.xxx.xxx to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.
What I would expect is not properly setup ssh keys but here comes the odd part: If we manually copy over the submodules contents through the filesystem, from that moment on everything works fine and pulling, switching branches in the submodule etc works just fine.
This made me assume that some of the git settings are in the submodule folders that i am copying over, but actually there are only two git files: The gitignore (which doesnt ignore anything special/suspicious) and a .git file which only contains gitdir: ../../../.git/modules/path/to/submodule
This should not have anything to do with permissions, so can anyone explain why a manual copy fixes the permission issues?