因為代碼分了兩個小組管理,一部分代碼使用跨平台語言實現,一部分使用原生實現。
所以使用Git submodule 來進行管理。
1,查看/更新 子模塊
$
git submodule add ssh://git@10.10.10.xx:443/xxx-iOS ios #添加子模塊
$ git submodule (status)
#
查看子模塊
$ git submodule update #更新項目內子模塊到最新版本
$ git submodule update --remote #更新子模塊為遠程項目的最新版本
git submodule foreach git pull
$
##以上方式均為更新master分支
## 使用下面的方式,更新 libb
的 dev
分支:
$ git config -f .gitmodules submodule.liba.branch dev $ git submodule update --remote
2,
刪除子模塊
- 刪除子模塊文件夾
$ git rm --cached assets
$ rm -rf assets
- 刪除
.gitmodules
文件中相關子模塊信息
[submodule "assets"]
path = assets
url = https://github.com/maonx/vimwiki-assets.git
- 刪除
.git/config
中的相關子模塊信息
[submodule "assets"]
url = https://github.com/maonx/vimwiki-assets.git
- 刪除
.git
文件夾中的相關子模塊文件
$ rm -rf .git/modules/assets
另一說
git rm --cached pod-library rm -rf pod-library rm .gitmodules
OVER
https://juejin.im/post/5aa11f486fb9a028e0140e34
https://www.jianshu.com/p/9000cd49822c
https://www.jianshu.com/p/0107698498af