【问题标题】:Git submodule: git@github.com: Permission denied (publickey). fatal: Could not read from remote repositoryGit 子模块:git@github.com:权限被拒绝(公钥)。致命:无法从远程存储库中读取
【发布时间】:2021-03-22 17:21:51
【问题描述】:

git submodule update --init --remote 有问题。 我收到错误:权限被拒绝并且无法克隆。但是我将 SSH 密钥添加到了我的 github 存储库中。我可以拉、推、git clone。

我拥有所有需要的访问权限。 我使用操作系统 Windows 10。 我将 .gitmodules 文件 url=git@github.com:xxx 更改为 url=https://github.com/xxx ,但没有帮助。

【问题讨论】:

    标签: python-3.x django windows git github


    【解决方案1】:

    Git 将尝试使用 ssh 而不是 https 克隆子模块。如果您尚未配置 ssh 密钥,这将失败。在.gitmodule 文件中将URL 从git@github.com 更改为https://github.com,否则请按照可能解决问题的步骤进行操作。

    1. 从本地删除子模块的文件夹。

    2. 打开 gitBash 并运行以下命令。

      git submodule sync
      git submodule update --init
      

    【讨论】:

    • 非常感谢!我已经删除了 git bush 中的 .gitmodule 和命令。这是炒锅!
    猜你喜欢
    • 2019-12-30
    • 2018-08-24
    • 2014-02-10
    • 1970-01-01
    • 2014-06-24
    • 2014-08-30
    • 2021-05-01
    • 2020-01-04
    相关资源
    最近更新 更多