问题:

当使用git clone东西时,开启了vpn可以访问git 官网,但是克隆会报错超时,需要手动配置一下代理

解决方法:

1. 配置 git 的代理

git config --global http.proxy "127.0.0.1:1080"  
git config --global https.proxy "127.0.0.1:1080"  

这里是关键:需要本地启动 vpn (最后的1080是端口号,如果提示端口冲突,可以自己换一个)

取消代理

git config --global --unset http.proxy

git config --global --unset https.proxy

 

2. 使用 https 方式  clone

$ git clone https://github.com/xxx.git

注意:这里必须使用 https 方式, ssh 方式即使配置了 git 的代理也不好使。。。

相关文章:

  • 2021-05-20
  • 2021-11-20
  • 2021-11-20
  • 2021-09-09
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-15
  • 2021-11-18
  • 2022-12-23
  • 2022-01-02
  • 2022-01-10
相关资源
相似解决方案