Environment variable GIT_SSH_COMMAND:

From Git version 2.3.0, you can use the environment variable GIT_SSH_COMMAND like this:

Note that -i can sometimes be overridden by your config file, in which case, you should give SSH an empty config file, like this:

Configuration core.sshCommand:

From Git version 2.10.0, you can configure this per repo or globally, so you don’t have to set the environment variable any more!