【问题标题】:No url found for submodule path 'Pods' in .gitmodules在 .gitmodules 中找不到子模块路径“Pods”的 url
【发布时间】:2021-07-27 11:15:13
【问题描述】:

我已将 Xcode 项目添加到 git 存储库中。当我运行以下命令时:

$ git submodule init

我收到以下错误:

fatal: No url found for submodule path 'Pods' in .gitmodules

我没有添加“Pods”子模块,它是自己添加的?

【问题讨论】:

    标签: ios xcode git git-submodules


    【解决方案1】:

    不确定为什么 Pods 会列在您的 .gitmodules 中。 This article 提及

    当存储库使用从另一个存储库克隆的文件但没有对为其创建的源存储库的映射引用时,会发生这种情况。

    需要将映射添加到您正在使用的存储库根目录中的.gitmodules 文件中。

    但在您的情况下,请编辑 .gitmodules 文件并删除 Pods 条目。

    并检查您的索引中是否有任何 Pod:

    git rm --cached -- Pods
    

    【讨论】:

    • git rm --cached -- Pods 解决了这个问题
    猜你喜欢
    • 1970-01-01
    • 2013-01-21
    • 2016-07-18
    • 1970-01-01
    • 1970-01-01
    • 2022-01-25
    • 2018-08-24
    • 2018-11-06
    • 1970-01-01
    相关资源
    最近更新 更多