关于git:5步删除git-submodule

11次阅读

共计 294 个字符,预计需要花费 1 分钟才能阅读完成。

1. 删除 submodule 缓存

须要先暂存 .gitmodules 文件, 否则会报错: fatal: please stage your changes to .gitmodules or stash them to proceed

git add .gitmodules
git rm --cached submodule_name

2. 删除 submodule 目录

rm -rf submodule_name

3. 批改.gitmodules

移除对应的 submodule 信息, 只有 1 个 submodule 信息也能够删除该文件.

4. .git/modules

移除对应的 submodule 目录

5. .git/config

移除对应的 submodule 信息

正文完
 0