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

问题描述

当我跑步时

git submodule update
No submodule mapping found in .gitmodules for path 'Classes/lib/AFKissXMLRequestOperation'

但我在当前存储库中没有子模块 Classes/lib/AFKissXMLRequestOperation

But I have no submodule Classes/lib/AFKissXMLRequestOperation in current repos

我的 git 配置是:

My git config is:

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
    ignorecase = true
    precomposeunicode = false
[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*
    url = [email protected]:why_ios.git
[branch "master"]
    remote = origin
    merge = refs/heads/master
[submodule "External/ios-SDNestedTable"]
    url = [email protected]:why/ios-SDNestedTable.git
[submodule "External/PSStackedView"]
    url = [email protected]:why/PSStackedView.git

和 .gitmodules 是:

and .gitmodules is:

[submodule "External/ios-SDNestedTable"]
    path = External/ios-SDNestedTable
    url = [email protected]:why/ios-SDNestedTable.git
[submodule "External/PSStackedView"]
    path = External/PSStackedView
    url = [email protected]:why/PSStackedView.git

推荐答案

检查您在 .git/modules 中是否也有正确的设置.从几个版本以前开始,git 在那里添加了一个条目.

check that you have the proper setting in .git/modules as well. Since a few versions ago, git adds an entry there.

此外,树可能在该路径上有一个提交对象.要摆脱它,你可以

Also, the tree probably has a commit object at that path. To get rid of it you can

git rm --cached Classes/lib/AFKissXMLRequestOperation

那应该一劳永逸地摆脱它.

that should get rid of it once and for all.

这篇关于在 .gitmodules 中找不到路径的子模块映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-03 22:47