【问题标题】:Clone submodules on Windows Powershell not possible无法在 Windows Powershell 上克隆子模块
【发布时间】:2022-11-05 08:02:21
【问题描述】:

我有一个配置了子模块的项目。它使用相对路径,因此应该通过 ssh 签出(因为我使用 ssh 克隆了父项目)。

我做了: git submodule update --init --recursive --remote

并且错误出现在 Windows Powershell 上:Permission denied

我想我也找到了原因。我的 ssh 密钥受密码保护。所以 powershell 应该像使用 git clone 一样询问我的密码。但显然事实并非如此。

所以我有一些解决方法:

  • 在 Windows 上使用 git bash(要求我输入密码,这很好用)
  • 不要为 ssh 使用密码
  • 不要使用 ssh

所有的解决方法都不理想。所以我想知道:这是一个已知问题/限制吗?我能对此做些什么吗?

【问题讨论】:

    标签: windows git powershell ssh


    【解决方案1】:

    如果这些子模块使用 SSH URL(检查您的.gitmodules),那么您可以尝试使用an ssh-agent in your Powershell session

    使用 ssh -Tv remoteUser@remoteServer 测试它(对于 GitHub 远程存储库,应为 ssh -Tv git@github.com

    第一个查询应该询问您的 SSH 密码,但在那之后,您应该能够在没有任何提示的情况下克隆/子模块更新。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-11-05
      • 2015-03-06
      • 2018-08-14
      • 1970-01-01
      • 1970-01-01
      • 2023-03-10
      • 1970-01-01
      • 2017-09-09
      相关资源
      最近更新 更多