公司內網使用git clone報錯ssh連線超時

weixin_34236869發表於2017-09-05

ssh -T git@github.com 測試ssh,報連線超時

249036-2ab895aa5be1576d.png
image.png

ssh -T -p 443 git@ssh.github.com 換成443埠,依然連線超時
https://help.github.com/articles/using-ssh-over-the-https-port/

249036-1e0d1ee8f729634a.png
image.png

這裡估計是公司代理上網,導致無法使用ssh https://stackoverflow.com/questions/15589682/ssh-connect-to-host-github-com-port-22-connection-timed-out

按照上面的說明將ssh換成https時git config --local -e報錯,先不管了~

249036-c16f7421fbecb950.png
image.png

關鍵

直接配置~/.gitconfig檔案
git config --global http.proxy http://userName:password@proxyaddress:port
git config --global https.proxy https://userName:password@proxyaddress:port
然後使用git clone https:這種模式

https://stackoverflow.com/questions/18356502/github-failed-to-connect-to-github-443-windows-failed-to-connect-to-github
https://stackoverflow.com/questions/496277/git-error-fatal-unable-to-connect-a-socket-invalid-argument

相關文章