Daniel Velkov Daniel Velkov - 5 months ago 32
Git Question

Passing ssh options to git clone

I'm trying to run

git clone
without ssh checking the repository host's key. I can do it from ssh like that:

ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no user@host

Is there any way to pass the same ssh options to the git clone command?

Edit: There is a restriction that I can't modify
or any other files on that machine.


Add them to your ~/.ssh/config:

Host host
HostName host
User user
SshOptions go here

The Host entry is what you’ll specify on the command line, and the HostName is the true hostname. They can be the same, or the Host entry can be an alias. The User entry is used if you do not specify user@ on the command line.

If you must configure this on the command line, set the GIT_SSH environment variable to point to a script with your options in it.