方法一:同事大力推荐,暂时还没试过,先记下来
https://github.com/goproxy/goproxy.cn/blob/master/README.zh-CN.md
方法二:从github镜像上clone下来
- 进到$GOPATH/src/golang.org/x路径下,打开cmd:
git clone --depth 1 https://github.com/golang/tools.git #为了防止失败,只取最近1次commit
git config --global http.sslVerify "false" #如果clone报错:OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054
方法三:设置全局代理,略复杂,而且用完要手动取消设置
- 设置代理端口
set http_proxy=127.0.0.1:1080
set https_proxy=127.0.0.1:1080
- 设置git代理
git config --global http.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
- 取消代理端口
set http_proxy=
set https_proxy=
- 取消git代理
git config --global --unset http.proxy
git config --global --unset https.proxy
网友评论