当你在Git仓库中尝试添加一个子模块(submodule),但遇到了“git submodule add already exists in the index”的错误信息时,这意味着你试图添加的子模块或其某些文件已经存在于Git的索引(index)中。Git索引是暂存区(staging area),用于记录下一次提交时要包含的文件更改。如果子模块的文件已经被添加到索引中(可能是...
git submodule add 时明明已经删了文件但是还提示【already exists in the index】时因为git的缓存导致的,需要删除缓存的文件夹即可 $ git submodule add git@g***ml.git 'autotest' already exists in the index $ git rm -r --cached autotest
在一个大项目中,需要用git submodule add命令添加一个子模块(添加一个业务项目),执行下面的命令报错: git submodule add url_to_repo src/pages/biz-prpPlan 'src/pages/biz-prpPlan' already exists in the index 二、问题分析及解决方法 1、查看这个文件夹下有些什么东西 git ls-files --stage projectfolde...
今天想在项目中添加一个submodule 一直报这个错, 原因是有相同名字的模块已经存在于git的索引中。 如果确认项目中没有同名的模块, 只需运行命令: git rm -r --cached XXXXX (报错模块的相对路径,即XXXXX already exists in the index 中的XXXXX)
用tortoisegit菜单中的submodule add,输入源地址和目标路径,确定后提示了一个错误,如下: 'components/modem' already exists in the index git did not exit cleanly (exit code 1) (1625 ms @ 2018/11/8 16:02:09) 这意思就是说我的仓库索引里还有之前子模块的路径呗,于是乎,我又来了一番操作: ...
站长@ 十七度 · 21-10-10 00:26 git submodule add 报错 already exists in the index gitsubmodule:alreadyexistsintheindex_嵌入式技术在路上-CSDN... 在github上面clone一个包含有submodule的repo的时... https://blog.csdn.net/xingqingly/article/details/... ...
git submodule add URL <path> 【注意】路径需要包含子模块的文件夹名称,如不包含会报错 <path> already exists and is not a valid git repo 【注意】如先前删除过目录,但没有及时commit提交到本地库,在引用同名称子模块时,会报错 <path> already exists in the index。
直接删除子模块并不能完全删除,再次添加的时候会报错'' already exists in the index. 用以下命令可以完全删除submodule: git rm --cached submodule子项目名字 rm -rf submodule子项目名字 执行完成后,再执行添加子模块命令即可,如果仍然报错,执行如下:
By default, submodules will add the subproject into a directory named the same as the repository, in this case “DbConnector”. You can add a different path at the end of the command if you want it to go elsewhere. If you rungit statusat this point, you’ll notice a few things. ...
git submoduleaddhttps://github.com/sronzheng/mysubmodule.git 如果在当前目录下,已经有一个同名的目录mysubmodule,则git会反馈如下错误提示。 'mysubmodule' already exists in the index 这时需要从git库中,先删除这个这个目录,再重新添加。 git rm-r mysubmodule ...