git 通过代理克隆GitHub仓库


windows环境使用局部配置

Git常用的有两种协议

 

不同的协议他的代理配置各不相同。core.gitproxy 用于 git:// 协议,http.proxy 用于 http:// 协议。
常见的git clone 协议如下:
不走代理:
  #使用http://协议   
  git clone https://github.com/EasyChris/baidu.git   
  #使用git://协议
  git clone git@github.com:EasyChris/baidu.git
走代理方式:
  #使用http://协议
  git clone -c http.proxy="http://127.0.0.1:1080" https://github.com/madrobby/zepto.git
  #通常小飞机的代理在本机地址是127.0.0.1 代理端口是1080
  git config http.proxy 'socks5://127.0.0.1:1080'
  #使用git://协议
  git config core.gitProxy 'socks5://127.0.0.1:1080'

 

windows环境下增加全局配置

git config --global http.proxy 'socks5://127.0.0.1:1080' 
git config --global https.proxy 'socks5://127.0.0.1:1080'

 

查看你的全局配置

git config --global -l

 

 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM