git bash - Using GIT_SSH_COMMAND in Git for Windows -


i'm using fourth release candidate of git windows 2.x now, , using git_ssh_command in shell avoid ssh's host verification. in git bash write this:

$ git_ssh_command="ssh -o userknownhostsfile=/dev/null -o stricthostkeychecking=no" git push origin master 

how can in windows cmd? can't find answers anywhere.

you don't have set environment variable anymore in windows.

with git 2.10+ (q3 2016), have possibility set config git_ssh_command, easier environment variable (and can set globally, or locally specific repo)

see commit 3c8ede3 (26 jun 2016) nguyễn thái ngọc duy (pclouds).
(merged junio c hamano -- gitster -- in commit dc21164, 19 jul 2016)

a new configuration variable core.sshcommand has been added specify value git_ssh_command use per repository.

core.sshcommand: 

if variable set, git fetch , git push use specified command instead of ssh when need connect remote system.
command in same form git_ssh_command environment variable , overridden when environment variable set.

it means git push can be:

cd /path/to/my/repo git config core.sshcommand 'ssh -o userknownhostsfile=/dev/null -o stricthostkeychecking=no'  # later on git push origin master 

Comments