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

 

 

 

相关文章:

  • 2021-11-24
  • 2021-07-24
  • 2021-09-10
  • 2022-02-20
  • 2021-10-16
  • 2021-09-23
  • 2021-04-04
猜你喜欢
  • 2021-06-24
  • 2022-01-10
  • 2021-11-28
  • 2021-10-14
  • 2021-11-28
  • 2021-09-07
  • 2021-12-24
相关资源
相似解决方案