如何在openshift中引用子模块?

我有一个OpenShift帐户,它提供了每个项目的Git仓库。我有一个主项目和两个较小的项目,总共有3个Git仓库。

我刚刚开始使用主项目中的两个较小的项目,并看到git可以使用submodule命令。 我已经将它们添加到自定义目录中,如下所示:

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

已经产生了如下目录结构:

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

我有.gitmodules文件

 [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/ 

这正是我想要的。 这一切都在本地工作。

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

问题是当我运行git推,它回来了这个错误:

 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. 

它看起来像我需要将主项目的ssh密钥添加到两个较小的项目,以便我可以ssh。 有谁知道我可以做到这一点,或有更好的方式在OpenShift中包含子模块?

我在这里先向您的帮助表示感谢。

它看起来像我需要将主项目的ssh密钥添加到两个较小的项目,以便我可以ssh

在父级(主)回购级别,情况不应该如此:所有推送都是推送.gitmodules ,以及2个表示这两个子模块的gitlinks ( 索引中的特殊条目 )。

更有可能推送没有find正确的.ssh/known_hosts或公共/专用ssh密钥,以推回到app.rhcloud.com上游repo:请参阅“ 与主机密钥validation的SSH连接问题失败…“错误 ”和“ 主机的真实性无法build立 ”。