Git - 嵌套存储库

标签 git

我有一个主项目,其中有一个来自单独的远程存储库的组件,该组件也必须与主项目一致更新/推送。不一定同时(我希望主项目的推送触发组件的推送),但是每当我需要时,我应该能够推送对主项目和组件所做的更改需要。

我怎样才能做到这一点,其结构抽象如下:

/root working directory of main project
    /some dir
        |
        |-> some file
        |
        |-> some file
    /component
        |
        |-> some file
        |
        |-> some file
        /subdir of component

组件将与其余部分分开跟踪?

最佳答案

您应该阅读有关 Git 子模块的内容:http://git-scm.com/book/en/Git-Tools-Submodules 我认为它完全符合您的需求。

关于Git - 嵌套存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16171937/

相关文章:

git clean 不删除子目录(非递归)

git - 是否可以在 Github 中使用 'fork a fork'?

php - 我怎样才能从 git status "On branch master\n Nothing to commit.."到 "On branch master\n Your branch is up to date\n Nothing to .."?”

git - 如何在 git clone --reference 之后分离替代品?

ios - 最佳实践 : how to add an external framework to xcode project which is under version control?

git push remote : warning: hooks. 邮件列表有多个值

git - 为什么 git 在 "resolving deltas"时需要网络连接?

git - git 中带注释的标签中的 `type commit`

git - 我如何运行 `git mv --index` (--index 选项在 git mv 上不可用)

GIT:如何查看原点的 pull/推送变化