带有配置 "recurse=true"的 git pull 不更新所有子模块

标签 git git-submodules

我运行了以下 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/

相关文章:

git-submodules - git 子模块的行为改变了吗?

git - 即使我不修改任何内容,提交 sha1sum 也会发生变化

git - 搜索文件的所有先前 Git 提交,了解谁添加了(拼写错误的)字符串

git - 是否有可能让 git 自动解决某些类型的 merge 冲突

git - 是否可以添加/启动一个新的 git 子模块并将忽略选项设置为某个值?

gitlab - 是否有任何自动方法来更新父 git repo 以指向其子模块的最新提交?

git - Jenkins 和更新 git 子模块

git - 你的分支落后了 2 次提交

git - 如何使用 Jenkins 克隆 BitBucket 存储库

git - 验证子模块初始化 [Git]