Git提示:You’ve added another git repository inside your current repository.
Git提示:You’ve added another git repository inside your current repository.

Git提示:You’ve added another git repository inside your current repository.

使用 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 .

   

如果您认为这篇文章给您带来了帮助,您可以在此通过支付宝或者微信打赏网站开发者。

欢迎加入我们的 微信交流群QQ交流群,交流更多精彩内容!
微信交流群二维码 QQ交流群二维码

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注