git-网络配置

通常在使用git的时候,由于github服务器位于国外,这时候push、clone、pull等远程操作的速度非常的缓慢,最多只有几十kb,对于几百MB的仓库不知猴年马月才能更新完,这时候只需要配置git相应的网络设置,这时候网速是杠杠的。

  1. 使用Http协议Http代理(用户级)

     git config --global http.proxy 127.0.0.1:port
     git config --global https.proxy 127.0.0.1:port
     #port为本地SVN的Http代理端口号
    
  2. 使用Http协议Scoks代理(用户级)

     git config --global http.proxy socks5://127.0.0.1:port
     git config --global https.proxy socks5://127.0.0.1:port
     #port为本地SVN的scoks代理端口
    
  3. 取消Http协议的代理(用户级)

     git config --global --unset http.proxy
     git config --global --unset https.proxy
    
  4. 针对特定的网站使用Http代理

     #未使用过,待验证
     git config --global http.https://github.com.proxy 127.0.0.1:port
     git config --global https.https://github.com.proxy 127.0.0.1:port
    
  5. 设定Http和Https Post数据的缓冲区大小(用户级)

     git config --global http.postBuffer 字节数