.gitmodule中找不到子模块的路径没有找到子模块映射 [英] No submodule mapping found in .gitmodule for a path that's not a submodule

查看:1058
本文介绍了.gitmodule中找不到子模块的路径没有找到子模块映射的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个子模块在 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 命令删除索引中的 特殊条目,指示子模块(具有特殊模式 160000 的'文件夹')。

如果在 .gitmodule 中没有引用 path ' Classes / Support / Three20 '),那么您需要将其删除,以避免在<$ c中找不到子模块映射

您可以检查索引中引用子模块的所有条目:

  git ls-files --stage | grep 160000 






先前的回答(2010年11月) p>

有可能你没有正确地声明你的初始子模块(即没有任何尾部'/',如 my old answer ,即使您的 .gitmodule 的路径看起来不错)



此主题提及:


从新克隆运行'git submodule init'时,你会得到同样的错误吗?

如果是这样,你有错误。



如果您没有子模块,请删除 .gitmodules 以及对
.git中子模块的引用/ config,并确保Pikimal目录中没有 .git 目录。

如果修复问题,请检入并执行相同操作在您的巡航工作副本上。


很明显,不要删除主要的 .gitmodules 文件,在你工作树中的其他额外的 .gitmodules 文件之后。




仍然以不正确的子模块初始化为主题, Jefromi 提到了实际上是gitlinks的子模块。



请参阅如何跟踪未跟踪的内容?,以便将此类目录转换为真实的子模块。


I have a project that has a submodule at lib/three20

My .gitmodule file looks like this:

[submodule "lib/three20"]
    path = lib/three20
    url = git://github.com/facebook/three20.git

I have cloned this in the past without errors, (git submodule init followed by a git submodule update) and it's been working for a while.

I tried to clone this to a new machine, and now I'm getting this error on git submodule init:

No submodule mapping found in .gitmodules for path 'Classes/Support/Three20'

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 .gitmodules file, so I don't see where it's getting this path from.

Any ideas?

解决方案

Following rajibchowdhury's answer (upvoted), use 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).

If that special entry path isn't referenced in the .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.

You can check all the entries in the index which are referencing submodules:

git ls-files --stage | grep 160000


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 .gitmodule has paths which looks ok in it).

This thread mentions:

do you get the same error when running 'git submodule init' from a fresh clone?
If so, you have something wrong.

If you have no submodules, delete .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.

Obviously, don't delete your main .gitmodules file, but look after other extra .gitmodules files in your working tree.


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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆