Passing ssh options to git clone

后端 未结 7 966
礼貌的吻别
礼貌的吻别 2020-11-30 23:16

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         


        
7条回答
  •  眼角桃花
    2020-11-30 23:49

    I think that update git to an version >= 2.3 and use GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" git clone user@host is the bet option, but if it not possible, @josh-lee gave a good option, but please, update your answer indenting the ssh config file.

    Host host
        HostName host
        StrictHostKeyChecking no
        UserKnownHostsFile /dev/null
    

提交回复
热议问题