.gitmodule中找不到子模块的路径没有找到子模块映射 [英] No submodule mapping found in .gitmodule for a path that's not a submodule
问题描述
我有一个子模块在 lib / three20
My .gitmodule
文件如下所示:
[submodulelib / three20]
path = lib / three20
url = git://github.com/facebook/three20.git
以前我克隆过这个,没有错误,( git submodule init
后跟一个 git子模块更新
)它已经工作了一段时间。
我试图克隆这个到一台新机器,现在我得到 git submodule上的这个错误init
:
在路径'Classes / Support / Three20'中找不到在.gitmodules中的子模块映射
该路径只是Xcode中的一个空文件夹,用于存放来自其他目录的项目。它不是 .gitmodules
文件的一部分,所以我没有看到它从哪里得到这条路。
任何想法?
遵循 rajibchowdhury 的答案(upvoted),使用 git rm $建议使用c $ c>
命令删除索引中的 特殊条目,指示子模块(具有特殊模式 160000
的'文件夹')。
如果在 您可以检查索引中引用子模块的所有条目: 先前的回答(2010年11月) p> 有可能你没有正确地声明你的初始子模块(即没有任何尾部'/',如 my old answer ,即使您的 此主题提及: 从新克隆运行'git submodule init'时,你会得到同样的错误吗? 如果您没有子模块,请删除 很明显,不要删除主要的 仍然以不正确的子模块初始化为主题, Jefromi 提到了实际上是gitlinks的子模块。 请参阅如何跟踪未跟踪的内容?,以便将此类目录转换为真实的子模块。 I have a project that has a submodule at My I have cloned this in the past without errors, ( I tried to clone this to a new machine, and now I'm getting this error on That path is just an empty folder in Xcode that I use to house the projects from the other directory. It's not part of the Any ideas? Following rajibchowdhury's answer (upvoted), use If that special entry path isn't referenced in the You can check all the entries in the index which are referencing submodules:
Previous answer (November 2010) It is possible that you haven't declared your initial submodule correctly (i.e. without any tail '/' at the end, as described in my old answer, even though your This thread mentions: do you get the same error when running 'git submodule init' from a fresh clone? If you have no submodules, delete Obviously, don't delete your main Still in the topic of "incorrect submodule initialization", Jefromi mentions submodules which actually are gitlinks. See How to track untracked content? in order to convert such a directory to a real submodule. 这篇关于.gitmodule中找不到子模块的路径没有找到子模块映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! .gitmodule
中没有引用 path ' Classes / Support / Three20
'),那么您需要将其删除,以避免在<$ c中找不到子模块映射
git ls-files --stage | grep 160000
.gitmodule
的路径看起来不错)
如果是这样,你有错误。
.gitmodules
以及对
.git中子模块的引用/ config,并确保Pikimal目录中没有 .git
目录。
如果修复问题,请检入并执行相同操作在您的巡航工作副本上。
.gitmodules
文件,在你工作树中的其他额外的 .gitmodules
文件之后。
lib/three20
.gitmodule
file looks like this:[submodule "lib/three20"]
path = lib/three20
url = git://github.com/facebook/three20.git
git submodule init
followed by a git submodule update
) and it's been working for a while.git submodule init
:No submodule mapping found in .gitmodules for path 'Classes/Support/Three20'
.gitmodules
file, so I don't see where it's getting this path from.git rm
command which is advised is for removing the special entry in the index indicating a submodule (a 'folder' with a special mode 160000
). .gitmodule
(like 'Classes/Support/Three20
' in the original question), then you need to remove it, in order to avoid the "No submodule mapping found in .gitmodules
for path" error message.git ls-files --stage | grep 160000
.gitmodule
has paths which looks ok in it).
If so, you have something wrong. .gitmodules
, and any references to submodules in
.git/config, and ensure the Pikimal dir does not have a .git
dir in it.
If that fixes the problem, check in and do the same on your cruise working copy. .gitmodules
file, but look after other extra .gitmodules
files in your working tree.