Git 未找到 SSH 密钥

Git SSH key not being found

我正在尝试将我的源代码推送到我们的本地 Git 存储库。我创建了一个 id_rsa 密钥并将该密钥添加到 GitLab,以及一个包含以下内容的配置文件:

Host git@git.repo.local
 IdentityFile H:\.ssh\id_rsa

当我在 Git Bash 中输入以下推送命令时,我收到 Could not read from remote repository. 错误:

$ git push git@git.repo.local:android/myApp.git

以前我在 C: 驱动器上工作时它工作正常,但现在我在服务器驱动器 (H:) 上工作时它似乎不喜欢它。

我是不是遗漏了一些设置?

尝试在您的配置文件中编辑此内容:

Host git.repo.local
 IdentityFile H:\.ssh\id_rsa