git - 解决某些443地址无法访问的方法 - 使用代理服务器
访问量: 2929
参考: http://www.eblogs.cn/git/165.html
git config --global http.https://github.com.proxy http://127.0.0.1:1080 git config --global https.https://github.com.proxy https://127.0.0.1:1080
然后正常操作就可以。(记得你的工具需要以https协议运行,而不是socks5 )
不要问我 如何搭建自己的代理服务器, 科学上网是每个 程序员必备的知识。
这台服务器是阿里云,所以没办法写的太透彻。
记得下载完毕之后,还需要把 git config --global的http.proxy 注释掉。
另, 如果socket代理服务器用不了 , 就使用 http/https的代理服务器.
1. 修改 .git/confg , 使用 https 的URL
[remote "origin"] #url = [email protected]:your-exchange/project1.git 注释掉这个 # 使用这个 https协议的 url = https://github.com/your-exchange/project1.git
2. 修改 ~/.gitconfig
[user] name = 申思维 email = [email protected] [core] editor = vim [push] default = matching [http "https://github.com"] proxy = http://127.0.0.1:1080 [https "https://github.com"] proxy = https://127.0.0.1:1080
就可以了.