仅从SO上的"git子模块"的结果数量来判断,这显然是一个常见且容易混淆的话题,因此我将尽可能精确.
忘记更新/提交/分支子模块的一切(我理解这一点使事情变得非常复杂),为什么每次更改分支时子模块都会被清空?根据我目前的理解,这使分支机构变得昂贵 ; 如果我在机场,不能轻易/廉价地连接怎么办?我做错了什么,还是有一些我还没有意识到的发展理念?
例子永远不会伤害
## make a new project
$> git --version
git version 1.7.5.4
$> mkdir new_proj; cd new_proj; git init
$> touch new_file_1.txt; touch new_file_2.txt
$> git add . && git commit -m "first commit"
## move into some development branch
$> git checkout -b cool_feature
$> <hack hack hack>
# in the middle, I add a submodule
$> git submodule add https://github.com/some/other_proj.git other_proj
$> git submodule update --init
$> ls -lR
new_file_1.txt
new_file_2.txt …Run Code Online (Sandbox Code Playgroud)