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/nul
The recently released git 2.3 supports a new variable "GIT_SSH_COMMAND" which can be used to define a command WITH parameters.
GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" git clone user@host
$GIT_SSH_COMMANDtakes precedence over$GIT_SSH, and is interpreted by the shell, which allows additional arguments to be included.