Git: GIT_SSH GIT_SSH_COMMAND

 

Fix permission

stat -L --format %a ~/.ssh/config

stat -L --format %A ~/.ssh/config

chmod -vR 600 ~/.ssh/config

 

ssh-agent

IdentitiesOnly no in ssh_config

ssh-add -v -t 3600 ~/.ssh/infringe

 

GIT_SSH

echo 'ssh -i ~/.ssh/infringe -F /dev/null -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no "$@"' > git_ssh

chmod -vR +x git_ssh

GIT_TRACE=1 GIT_SSH='./git_ssh' git push repo

 

GIT_SSH_COMMAND

GIT_SSH_COMMAND='ssh -i ~/.ssh/infringe -F /dev/null -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' git push repo

 

git config (core.sshCommand)

git config --local core.sshCommand 'ssh -i ~/.ssh/infringe -F /dev/null -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'

 

-c 

git -c 'core.sshCommand=ssh -i ~/.ssh/infringe -F /dev/null -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' push repo

 

posted @ 2023-03-24 11:34  ascertain  阅读(181)  评论(0编辑  收藏  举报