【问题标题】:how to update one submodule git?如何更新一个子模块 git?
【发布时间】:2017-12-28 07:28:55
【问题描述】:

我有几个子模块,我只想更新其中一个。

我认为这个命令会更新.gitmodules中的所有内容

git submodule update --init --recursive --remote

不过,我只想更新其中一个模块。

【问题讨论】:

标签: git github


【解决方案1】:

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。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-12-04
    • 2012-04-27
    • 2012-09-14
    • 1970-01-01
    • 2013-05-19
    • 1970-01-01
    • 2012-07-09
    相关资源
    最近更新 更多