我有几个子模块,我只想更新其中一个。
我认为这个命令会更新 .gitmodules
中的所有内容
git submodule update --init --recursive --remote
不过我只想更新其中一个模块。
最佳答案
git submodule update
command将路径作为参数。
使用您要更新的子模块的路径,因为该路径记录在您的 .gitmodules
中。
git submodule update --init --remote a/submodule/path
确保:
- 你在
.gitmodule
所在的位置执行命令。 - your submodule follows a branch first .
对于手动更新,您还可以进入子模块文件夹,然后自己执行 git checkout aBranch/git pull
。然后返回父仓库,为该子模块添加并提交新的 gitlink SHA1。
关于git - 如何更新一个子模块 git?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45251319/