菜单 学习猿地 - LMONKEY

VIP

开通学习猿地VIP

尊享10项VIP特权 持续新增

知识通关挑战

打卡带练!告别无效练习

接私单赚外块

VIP优先接,累计金额超百万

学习猿地私房课免费学

大厂实战课仅对VIP开放

你的一对一导师

每月可免费咨询大牛30次

领取更多软件工程师实用特权

入驻
320
0

Git错误:warning: adding embedded git repository: hint: You've added another git repository inside your current repository.

原创
05/13 14:22
阅读数 68081

问题:

提交后报如下异常:

$ git add .            


warning: adding embedded git repository:xxxxxxxxxx
hint: You've added another git repository inside your current repository.
hint: Clones of the outer repository will not contain the contents of
hint: the embedded repository and will not know how to obtain it.
hint: If you meant to add a submodule, use:
hint:
hint: git submodule add <url>xxxxxxxxxx
hint:
hint: If you added this path by mistake, you can remove it from the
hint: index with:
hint:
hint: git rm --cached   xxxx
hint:
hint: See "git help submodule" for more information.

 

原因:

即在本地初始化的仓库(使用 git init的文件夹) 中的某一个文件夹,也含有 .git 文件 。

解决:

删除子文件夹里的.git文件,然后重新add、commit、push

 

发表评论

0/200
320 点赞
0 评论
收藏