问题描述
使用git子模块和子树有什么区别?
h2_lin>解决方案使用git子模块和子树有什么区别?
h2_lin>解决方案
您只在您的父回购库中保留引用( ,)
您可以使子模块遵循子模块远程回购分支的HEAD,其中:
o 。 (指定要跟随的分支)
o git submodule update --remote
它会将子模块的内容从<$ c更新为最新的HEAD $ c>< repository> /< branch> ,默认 origin / master
。即使使用 - remote
,您的主项目仍会跟踪子模块HEAD的散列值。
What are the conceptual differences between using git submodule and subtree?
What are the typical scenarios for each?
You can make a submodule to follow the HEAD of a branch of a submodule remote repo, with:
o git submodule add -b <branch> <repository> [<path>]
. (to specify a branch to follow)
o git submodule update --remote
which will update the content of the submodule to the latest HEAD from <repository>/<branch>
, by default origin/master
. Your main project will still track the hashes of the HEAD of the submodule even if --remote
is used though.
这篇关于git子模块和子树之间的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!