【发布时间】:2016-10-11 07:26:44
【问题描述】:
我正在尝试从 .bat 文件中自动克隆一个 repo。
我使用 ssh,因此 .bat 文件首先将“id_rsa”文件移动到“user\.ssh”文件夹。
然后,当我运行“git clone ssh://repo c:\repo”时,我得到了问题
The authenticity of host can't be established.
RSA key fingerprint is ........
Are you sure you want to continue connecting (yes/no)?
如果我手动回答“是”,它会起作用,并且“known_hosts”文件会在“user\.ssh”文件夹中创建。现在,如果我运行 .bat 文件,git clone 将毫无问题地工作。
我需要通过 .bat 文件静默执行此操作。
我试图从.bat 文件中回答yes 并添加“> /dev/nul 2>&1”,但没有成功。
有什么想法吗?
【问题讨论】: