我运行了以下 git 命令来更新我的配置:
git config --global submodule.recurse true
.gitconfig 中的条目现在看起来像这样:
[submodule]
recurse = true
我的期望是之后 git pull
也会更新我所有的子模块。但是运行
git submodule update --init –recursive
在 pull 之后仍然更新了一些子模块。
我是否误解了配置设置的影响,或者是否存在 git pull 仍然不会更新子模块的情况?
最佳答案
您的问题是 新 由 pull 引入的子模块不是由 git pull
创建的吗?如果是,那么这是一个已知错误,请参阅 git help pull
;
BUGS
Using --recurse-submodules can only fetch new commits in already checked out submodules right now. When e.g. upstream added a new submodule in the just fetched commits of the superproject the submodule itself can not be fetched, making it impossible to check out that submodule later without having to do a fetch again. This is expected to be fixed in a future Git version.
关于带有配置 "recurse=true"的 git pull 不更新所有子模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52424653/