通过相对路径添加子模块

时间:2016-12-16 07:04:49

标签: git git-submodules

关于SO的关注this answer我明白在git 1.8.4之后,可以从任何地方(不仅仅是顶层)添加子模块。我正在使用git版本2.7.4,当我这样做时:

git submodule add ../../../functest

我明白了:

Relative path can only be used from the toplevel of the working tree

我在opnfvdocs/docs/submodules。我想在opnfvdocs/functest内添加opnfvdocs/docs/submodules,以便.gitmodules

中有相对路径

树结构是:

github.com/OPNFV
|-opnfvdocs
|-functest

我错过了什么吗?

1 个答案:

答案 0 :(得分:0)

要在特定路径创建子模块,请留在顶层,并提供路径作为最后一个参数:

opnfvdocs$ git submodule add ../functest docs/submodules/functest
相关问题