【发布时间】:2017-12-28 07:28:55
【问题描述】:
我有几个子模块,我只想更新其中一个。
我认为这个命令会更新.gitmodules中的所有内容
git submodule update --init --recursive --remote
不过,我只想更新其中一个模块。
【问题讨论】:
-
你想更新一个子模块到最新的提交吗?见这里:stackoverflow.com/questions/5828324/…
我有几个子模块,我只想更新其中一个。
我认为这个命令会更新.gitmodules中的所有内容
git submodule update --init --recursive --remote
不过,我只想更新其中一个模块。
【问题讨论】:
git submodule update command 将路径作为参数。
使用您要更新的子模块的路径,因为所述路径记录在您的.gitmodules中。
git submodule update --init --remote a/submodule/path
确保your submodule follows a branch first。
对于手动更新,您也可以进入子模块文件夹,并自己做一个git checkout aBranch/git pull。然后返回父 repo,为该子模块添加并提交新的 gitlink SHA1。
【讨论】: