1

I've got an account with OpenShift which provides a git repository for each project you to work in. I've got one main project and two smaller projects resulting in a total of 3 git repositories.

I have just started to use the two smaller projects in the main project and seen that git can use the submodule command. I've added them both to the custom directory like so:

git submodule add ssh://...@app.rhcloud.com/~/git/app.git/
git submodule add ssh://...@api.rhcloud.com/~/git/api.git/

which has produced a directory structure like so:

node_modules
custom
    app ------ full of tasty files
    api ------ full of tasty files
index.js
.gitmodules

Within the .gitmodules file I have

[submodule "custom/api"]
  path = custom/api
  url = ssh://...@api.rhcloud.com/~/git/api.git/
[submodule "custom/app"]
  path = custom/app
  url = ssh://...@app.rhcloud.com/~/git/app.git/

Which is exactly what I want. It all works locally.

git add --all
git commit -m "new submodules"
git push

The issue is when I run the git push, it comes back with this error:

remote: Host key verification failed.
remote: fatal: Could not read from remote repository.
remote:
remote: Please make sure you have the correct access rights
remote: and the repository exists.

It looks like I need to add the ssh key of the main project to the two smaller projects so that I can ssh. Does anyone know how I can do this or have a better way of including submodules in OpenShift?

Thanks for the help in advance.

chris31389
  • 8,414
  • 7
  • 55
  • 66
  • possible duplicate of [How can I auto-deploy my git repo's submodules on push?](http://stackoverflow.com/questions/25695346/how-can-i-auto-deploy-my-git-repos-submodules-on-push) –  Aug 31 '15 at 16:17

1 Answers1

1

It looks like I need to add the ssh key of the main project to the two smaller projects so that I can ssh

At the parent (main) repo level, this shouldn't be the case: all the push does is to push the .gitmodules, and 2 gitlinks (special entries in the index) representing those 2 submodules.

It is more likely that the push doesn't find the proper .ssh/known_hosts, or the public/private ssh keys in order to push back to the app.rhcloud.com upstream repo: See "SSH connection problem with “Host key verification failed…” error" and "The authenticity of host can't be established".

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250