在.gitmodules中找不到路径的子模块映射

why*_*why 30 git version-control git-submodules

我跑的时候

git submodule update
No submodule mapping found in .gitmodules for path 'Classes/lib/AFKissXMLRequestOperation'
Run Code Online (Sandbox Code Playgroud)

但我Classes/lib/AFKissXMLRequestOperation目前的回购中没有子模块

我的git配置是:

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
    ignorecase = true
    precomposeunicode = false
[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*
    url = git@github.com:why_ios.git
[branch "master"]
    remote = origin
    merge = refs/heads/master
[submodule "External/ios-SDNestedTable"]
    url = git@github.com:why/ios-SDNestedTable.git
[submodule "External/PSStackedView"]
    url = git@github.com:why/PSStackedView.git
Run Code Online (Sandbox Code Playgroud)

和.gitmodules是:

[submodule "External/ios-SDNestedTable"]
    path = External/ios-SDNestedTable
    url = git@github.com:why/ios-SDNestedTable.git
[submodule "External/PSStackedView"]
    path = External/PSStackedView
    url = git@github.com:why/PSStackedView.git
Run Code Online (Sandbox Code Playgroud)

Ada*_*ruk 96

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

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

git rm --cached Classes/lib/AFKissXMLRequestOperation
Run Code Online (Sandbox Code Playgroud)

应该一劳永逸地摆脱它.

  • 先生,让我摆脱了某些疯狂! (9认同)
  • 如果您来自未来git的作者最终实现`git submodule update --init --recursive --justworkdammit`的项目,请投票支持 (4认同)