本帖最后由 Qter 于 2020-2-4 12:00 编辑
git submodule 增加 删除及更新URL
都是基于git根路径的
增加一个submodule
git submodule add https://github.com/cisco/openh264 open_source_code/openh264再如:
git submodule add https://github.com/hechengjin/mimetic.git src/firemail_solution/Ext/mimetic
切记不能直接修改.gitmodules
修改后,先再子模块提交,然后主模块也能检查出子模块的修改,主模块也要提交一下(但提交的内容并不是真实修改的东西,应该是对应的分支进展情况信息)
通过界面如下:
git根目录下 右键 -> TortoiseGit -> 添加子模块
删除一个submodule1.删除 .gitsubmodule中对应submodule的条目 2.删除 .git/config 中对应submodule的条目 3.执行 git rm --cached {submodule_path}。注意,路径不要加后面的“/”。例如:你的submodule保存在 supports/libs/websocket/ 目录。执行命令为: git rm --cached supports/libs/websocket 更新submodule的URL
1.更新 .gitsubmodule中对应submodule的条目URL 2.更新 .git/config 中对应submodule的条目的URL 3.执行 git submodule sync 通过界面如下:
git根目录下 右键 -> TortoiseGit -> 更新子模块
|