经常需要在Github上拉代码,这速度实在是慢,慢~~ 慢~~~
常规处理方法
- 使用国内的Git网站Clone
- 使用工具提供的打包下载
- 使用代理
1和2的方法对那些没有关联库引用还是非常方便快捷,如果下的库有关联库就是个大麻烦。
Git代理设置方法
如你用的Socket代理是 127.0.0.1:10808
全局代理:
git config --global http.proxy 127.0.0.1:10808
局部代理:,在github clone 仓库内执行
git config --local http.proxy 127.0.0.1:10808
取消代理:
git config --global --unset http.proxy
git config --local --unset http.proxy
特定地址使用代理
如对 github.com 设置代理, 有两个方法
使用命令
# 全局使用
git config --global http.https://github.com.proxy http://127.0.0.1:10809
# 取消代理
git config --global --unset http.https://github.com.proxy
# 特定库
git config --local http.https://github.com.proxy http://127.0.0.1:10809
# 取消代理
git config --local --unset http.https://github.com.proxy
编辑配置文件
TortoiseGit 打开设置Git分类中可以找到,直接进行编辑.
- mac直接打开
~/.gitconfig
- windows在用户根目录下 如
C:\Users\Administrator\.gitconfig
在文件中加入下面配置
[http "https://github.com"]
proxy = http://127.0.0.1:10809