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