git clone GitHub repository through a proxy

windows environment using local configuration

Git, there are two commonly used protocols

 

Different protocols his proxy configurations vary. core.gitproxy for git: // protocol, http.proxy for HTTP: // protocol. 
Common git clone agreed as follows:
Do not go Agent:
  # Use HTTP: // protocol    
  git clone HTTPS: // github.com/EasyChris/baidu.git    
  # use git: // protocol 
  git clone [email protected]: EasyChris / baidu.git
Go Acting:
  # Use HTTP: // protocol 
  git clone -c http.proxy = " http://127.0.0.1:1080 " HTTPS: // github.com/madrobby/zepto.git 
  # usual small plane in the proxy local address is 127. 0.0 . 1 proxy port is 1080
  config http.proxy git 'Socks5: //127.0.0.1: 1080 ' 
  # use git: // protocol 
  git config core.gitProxy ' Socks5: //127.0.0.1: 1080 '

 

Increase in global configuration windows environment

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

 

View your global configuration

git config --global -l

 

 

 

Guess you like

Origin www.cnblogs.com/pbblogs/p/11946622.html