公司内网使用git clone报错ssh连接超时

ssh -T [email protected] 测试ssh,报连接超时

image.png

ssh -T -p 443 [email protected] 换成443端口,依然连接超时
https://help.github.com/articles/using-ssh-over-the-https-port/

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报错,先不管了~

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

你可能感兴趣的:(公司内网使用git clone报错ssh连接超时)