【问题标题】:Git Clone Failing in Windows Batch ScriptWindows 批处理脚本中的 Git 克隆失败
【发布时间】:2016-12-17 06:36:15
【问题描述】:

我在 Git bash 终端和普通命令提示符下执行了这个命令 "C:\Program Files (x86)\Git\bin\git.exe" clone ssh://<user>@<org>:<path to repo>

在 Git Bash 终端中执行时,克隆工作正常,但在命令提示符下运行时,出现以下错误。

Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

我需要通过 Windows 批处理脚本运行 git clone,这就是为什么 我需要让它通过命令行运行。如何完成这项工作?

注意 :-
1.将公钥添加到使用ssh-keygen生成的remote(gerrit)。

【问题讨论】:

    标签: windows git bash ssh gerrit


    【解决方案1】:

    从命令行运行时找不到您的 SSH 身份。确保%HOME%\.ssh 目录包含您的密钥。

    【讨论】:

    • 是的,它包含密钥。我认为如果不存在密钥,那么尽管 git bash 也不应该工作
    猜你喜欢
    • 1970-01-01
    • 2021-01-13
    • 2011-06-11
    • 2019-04-02
    • 1970-01-01
    • 2019-05-10
    • 1970-01-01
    • 1970-01-01
    • 2018-07-29
    相关资源
    最近更新 更多