I'm trying to do a git clone
trough a bash script, but the first time that I run the script and the server is not known yet the script fails. I have something like this:
yes | git clone [email protected]:repo/repoo.git
The authenticity of host 'github.com (207.97.227.239)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)?
But it's ignoring the yes
. Do you know how to force git clone
to add the key to the known hosts?
echo yes | git clone [email protected]:repo/repoo.git
?echo yes
is not a good approach: the second time you run the command, ssh won't ask if you want to continue because the server key will already be known.