Git 设置子模块以跟随分支
示例
子模块始终在特定的提交SHA1(“gitlink”,父存储库索引中的特殊条目)处检出
但是可以请求将该子模块更新为该子模块远程存储库分支的最新提交。
而不是进入每个子模块,执行agitcheckoutabranch--trackorigin/abranch,gitpull,您可以简单地(从父仓库中)执行a:
git submodule update --remote --recursive
由于子模块的SHA1会更改,因此您仍然需要遵循以下步骤:
git add . git commit -m "update submodules"
假设子模块为:
添加了一个分支以遵循:
gitsubmodule-babranch--/url/of/submodule/repo
或配置(对于现有子模块)以遵循分支:
cd/path/to/parent/repo
gitconfig-f.gitmodulessubmodule.asubmodule.branchabranch
热门推荐
10 儿子立冬祝福语简短独特
11 对当兵的祝福语简短
12 侄儿高考试祝福语简短
13 伴郎红包祝福语朋友简短
14 媳妇生日简短祝福语朋友
15 公司年会祝福语简短最好
16 元旦感恩祝福语简短大全
17 红包祝福语简短10字
18 周六早晨祝福语简短