Is there a way to set the GIT_SSH environment variable in the gitconfig file?
GIT_SSH , if specified, is a program that is invoked instead of ssh when Git tries to connect to an SSH host. It is invoked like $GIT_SSH [username@]host [-p <port>] <command> .
Since my 2013 answer (Git 1.8.3.4), a new configuration has been set: core.sshCommand
If this variable is set,
git fetch
andgit push
will use the specified command instead ofssh
when they need to connect to a remote system.
The command is in the same form as theGIT_SSH_COMMAND
environment variable and is overridden when the environment variable is set.
It has been introduced in Git 2.10, commit 3c8ede3, June 2016
Since then, you have Git 2.13, commit dd33e077, Feb. 2017, which has ssh.variant
Depending on the value of the environment variables
GIT_SSH
orGIT_SSH_COMMAND
, or the config settingcore.sshCommand
, Git auto-detects whether to adjust its command-line parameters for use with plink or tortoiseplink, as opposed to the default (OpenSSH).The config variable
ssh.variant
can be set to override this auto-detection; valid values aressh
,plink
,putty
ortortoiseplink
.
Any other value will be treated as normal ssh. This setting can be overridden via the environment variableGIT_SSH_VARIANT
.
For those, I need to use the SSH client that Git for Windows came with
So for the repos where you need ssh instead of putty, you can use both settings to set exactly in your configuration what you want.
cd /path/to/my/repo
git config ssh.variant ssh
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With