使用 git add . 命令时,终端提示:
警告:正在添加嵌入式 git 仓库:ImageSlim_iOS
提示: You've added another git repository inside your current repository.
提示: Clones of the outer repository will not contain the contents of
提示: the embedded repository and will not know how to obtain it.
提示: If you meant to add a submodule, use:
提示:
提示: git submodule add <url> ImageSlim_iOS
提示:
提示: If you added this path by mistake, you can remove it from the
提示: index with:
提示:
提示: git rm --cached ImageSlim_iOS
提示:
提示: See "git help submodule" for more information.
提示: Disable this message with "git config set advice.addEmbeddedRepo false"
Git“警告提示”,表示当前仓库中添加了一个“嵌套的 Git 仓库”(ImageSlim_iOS 目录本身已经是一个独立的 Git 仓库),因此当执行 git add . 时,Git 发现另一个仓库当作普通文件夹提交进来了。
解决方案:
可以把新移入的 ImageSlim _iOS 目录,作为普通文件夹。
rm -rf ImageSlim_iOS/.git
然后重新 git add .
