【发布时间】:2014-03-23 11:26:29
【问题描述】:
我正在尝试将一个目录变成一个子模块,并有效地将这个东西变成一个 git 超级项目/项目,里面有专门的子模块。我有一个“构建”目录(对于我正在制作的东西是必需的,因为一些依赖项是封闭源代码,因此不在 git repo 中,这意味着有些人无法构建自己的版本),但我想把它变成一个单独的仓库,放在和以前一样的位置。也就是说,我希望它不是 /built 作为 repo 跟踪的目录,而是 /built 作为不同 repo 跟踪的子模块。
但是,当我尝试删除 /built、提交并执行 git submodule add BUILT_REPO_URL built 时,我得到:
A git directory for 'built' is found locally with remote(s):
origin BUILT_REPO_URL
If you want to reuse this local git directory instead of cloning again from
BUILT_REPO_URL
use the '--force' option. If the local git directory is not the correct repo
or you are unsure what this means choose another name with the '--name' option.
(我已将 BUILT_REPO_URL 替换为适当的 git 存储库托管 URL。)
我不想重命名该目录,因为这看起来很奇怪,而且我有构建脚本以及我必须更改的东西。此外,我还想对其他目录执行此操作,并且它们具有基于我正在使用的框架的相当设置的目录结构。我试过从缓存中删除文件(那里没有)和其他类似的步骤。该问题也无法通过 Google 搜索,因为我发现的所有结果都是将子模块更改为具有相同目录名称的不同子模块。
【问题讨论】:
标签: git local directory git-submodules