The git (starting with git version 2.10) configuration core.sshCommand allow to pass arbitrary options to the SSH command, used on git pull, git fetch, and git push.
Using this configuration, we can pass a custom path to a ssh key, as well as a know_host file and or ssh .config file.
This is usefull in situations where you can run git commands from the shell, but do not have root access, like a exec() command executed from a PHP page.
[core]
sshCommand = "ssh -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=[ABSOLUTE PATH TO FILE]/know_hosts -i [ABSOLUTE PATH TO FILE]/id_rsa_custom_key -F /dev/null"