I'm writing a rust script to execute some code on different git repositories. As I want the experiments to be reproducible the tools must automatically clone the repositories. I though that the best way to keep control access is to generate SSH key for the users. The idea is to grant access for collaborators only in a first time and after publish the private key when the code is released.
I view on a forum that a SSH key can be given to git with the command :
GIT_SSH_COMMAND="ssh -i /path/to/private_id" git clone email@example.com:xxx/my-repository
My first question is : How I indicate to
std::process::Command that I want to prefix
git clone with
My second question is : When I run the command line,
git ask :
The authenticity of host 'github.com (220.127.116.11)' can't be established. RSA key fingerprint is SHA256:foobarbazxxxxxxxx.... Are you sure you want to continue connecting (yes/no/[fingerprint])?
I want to the user to answer the question, but I don't know how to pipe the user input into the subprocess.
Thank you to help !