
1 使用了 git config --global url."https://".insteadOf git://
2 使用了 git config --global http.proxy [公司 proxy IP ]
3 改变端口 Host github.com User [email protected] Hostname ssh.github.com PreferredAuthentications publickey IdentityFile ~/.ssh/id_rsa Port 443
ssh -T [email protected] ssh: connect to host ssh.github.com port 443: Connection timed out ute@3-5-CLOUD503:~/.ssh$ vim config 。。。。
1 aru Sep 26, 2017 |
2 ysc3839 Sep 26, 2017 via Android 你这个说的不明不白的,仓库到底用的是什么协议?据我所知 GitHub 不支持 git 协议,只支持 https 和 ssh 协议。 https 协议的话,还要加个 git config --global https.proxy http://host:port ssh 协议的话,直接设置走代理不方便,我的建议是用 SOCKS 端口转发,$$R 也自带有端口转发的功能。 |
3 ysc3839 Sep 26, 2017 via Android 另外,可以直接用环境变量设置代理 export all_proxy=http://host:port 没记错的话,Git 通过 curl 来进行 http/https 请求,具体代理格式可以看 curl 的文档。 https://curl.haxx.se/libcurl/c/CURLOPT_PROXY.html |
4 Marfal Sep 26, 2017 @ysc3839 支持 git 协议,需要在 ~/.ssh/config 里设置 Host github.com HostName github.com User git ProxyCommand nc -v -x 127.0.0.1:8080 %h %p |
6 jiangbingo OP 感谢以上 V 友,待会儿就去试试。 |