GDB

git submodule

Updated:

添加

git submodule add <url> <path>
  • url:子模块仓库地址
  • path:本地存放路径

初始化

git submodule update --init --recursive

或者

git submodule init
git submodule update

更新

cd <path>
git pull origin <branch>

删除

  • 删除submodule缓存

    git rm --cached <path>
  • 删除submodule目录

    rm -rf <path>
  • 删除文件 .gitmodules 中对应子模块内容

  • 删除 .git/modules 对应子模块目录

    rm -rf .git/modules/<path>
  • 删除 .git/config 中对应子模块内容