git add子模块没有repo名称

时间:2014-01-19 22:45:22

标签: git github git-submodules

我在github上有2个存储库:第一个是cURL库,第二个是我正在编写的项目。我正在尝试将我的库作为子模块添加到我的项目中:

cd /www/fifa14api/CI-FIFA14-API/
git submodule add git@github.com:ctepeo/CI-cURL.git

我的项目基于CodeIgniter,所以文件结构看起来像

/application/
/system/
index.php

我在repo的库已准备好CodeIgniter结构:

/application/
     /libraries/
         curl.php

当我添加子模块时,我想“合并”它们(将我的curl.php放在项目的右侧目录中),但是它会在root创建CI-cURL (repo name)文件夹,所以我得到了

/application/
/system/
/CI-cURL/
    /application/
        curl.php
index.php

添加子模块时,如何(并且可能?)排除存储库的名称?

1 个答案:

答案 0 :(得分:1)

Git子模块是完全成熟的git存储库,所以你不能只使用子模块检查一部分git repo:它需要有自己的文件夹。但是,您可以根据需要为该文件夹命名:git submodule add git@hostname:location.git path/to/module将子模块克隆到您的git仓库中的path/to/module

相关问题