skip to content
Logo 三七の小站

在 VS code 中禁止使用系统代理, 解决 github 无法访问

/ 1 min read

在使用代理软件的情况下, git 的代理端口和系统代理端口不一致, 导致开启系统代理时, 无法通过 vs code 连上 github. 解决方法一是改变 git 的代理. 方法二: 关闭系统代理.

1. 配置全局代理

Terminal window
git config --global http.proxy http://127.0.0.1:7890
git config --global https.proxy http://127.0.0.1:7890

2. 关闭系统代理

1. 配置 hosts 文件

访问:https://ip.tool.chinaz.com/github.com 将获取到的 ip 填入 hosts 文件中 Linux \ macOS

sudo nano /etc/hosts

Windows

%SystemRoot%\System32\drivers\etc\hosts

2. 关闭系统代理

然后git push

3. 登录账户

账户 -> 云更改