有没有办法自动更新 git 个子模块?
Is there a way to automatically update git submodules?
我目前在 github 上有一个包含子模块的存储库。为了在任何地方更新子模块,我做了一个 git pull
来拉主 repo,但必须从子模块的目录中做一个 git pull origin master
才能更新子模块。当我在主项目 repo 中执行 git pull
时,有什么方法可以自动更新子模块吗?
来自man git pull
:
git pull --recurse-submodules=yes
--[no-]recurse-submodules[=yes|on-demand|no]
This option controls if new commits of all populated
submodules should be fetched and
updated, too (see git-config(1) and gitmodules(5)).
If the checkout is done via rebase, local submodule commits
are rebased as well.
If the update is done via merge,
the submodule conflicts are resolved and checked out.
我目前在 github 上有一个包含子模块的存储库。为了在任何地方更新子模块,我做了一个 git pull
来拉主 repo,但必须从子模块的目录中做一个 git pull origin master
才能更新子模块。当我在主项目 repo 中执行 git pull
时,有什么方法可以自动更新子模块吗?
来自man git pull
:
git pull --recurse-submodules=yes
--[no-]recurse-submodules[=yes|on-demand|no]
This option controls if new commits of all populated
submodules should be fetched and
updated, too (see git-config(1) and gitmodules(5)).
If the checkout is done via rebase, local submodule commits
are rebased as well.
If the update is done via merge,
the submodule conflicts are resolved and checked out.