git设置代理

一. git 设置http代理

  1.设置代理 http/https协议(clone https://前缀的repo会走ss)

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

 

   会在~/.gitconfig下加上对应代理
2.git@github.com走的是ssh协议,所以配置ssh代理
 
   配置.ssh/config (确保安装了 NetCat)
   
    Host github.com bitbucket.org
    ProxyCommand            nc -x 127.0.0.1:1080 %h %p

posted on 2023-07-10 16:51  帅胡  阅读(568)  评论(0编辑  收藏  举报

导航