使用GitHub参与一些大型项目时,clone的速度太慢,甚至偶尔还中断,因此配置代理来加快速度看,我使用的代理是socks协议,代理监听的端口是10808
配置git proxy
全局配置
git config --global http.proxy "socks://localhost:10808"
git config --global https.proxy "socks://localhost:10808"
全局设定要记得在不用的时候 unset
非全局
在一个空文件夹内初始化项目
git init
进行代理配置
git config http.proxy "socks://localhost:10808"
git config https.proxy "socks://localhost:10808"
设置远程仓库地址(以https://github.com/apache/echarts-doc.git为例)
git remote add origin https://github.com/apache/echarts-doc.git
git pull // 拉取仓库