我想以非交互式方式克隆一个 repo。克隆时,git 要求确认主机的指纹:
The authenticity of host 'bitbucket.org (207.223.240.182)' can't be established.
RSA key fingerprint is 97:8c:1b:f2:6f:14:6b:5c:3b:ec:aa:46:46:74:7c:40.
Are you sure you want to continue connecting (yes/no)? no
Run Code Online (Sandbox Code Playgroud)
每次出现这个问题时,我如何强制“是”?我尝试使用yes yes | git clone ...
,但它不起作用。
编辑:这是一个解决方案:我可以自动将新主机添加到 known_hosts 吗?(使用 ssh-keyscan 将所有内容添加到 known_hosts)。