Git 报错 443 解决方案

通常是因为 GitHub 服务器在国外导致连接超时。可以手动配置代理来解决,以下以本地 10808 端口为例(需已开启代理软件)。

提示:socks5 格式(socks5://)是通用写法;若使用 http 代理,格式改为 http://127.0.0.1:端口号。

Git 代理配置

配置代理(socks5 协议,推荐)

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

配置代理(http 协议)

git config --global http.proxy http://127.0.0.1:10808
git config --global https.proxy http://127.0.0.1:10808

查看代理

git config --global --get http.proxy
git config --global --get https.proxy

取消代理

git config --global --unset http.proxy
git config --global --unset https.proxy

npm 代理配置

配置代理

npm config set proxy socks5://127.0.0.1:10808
npm config set https-proxy socks5://127.0.0.1:10808

查看代理

npm config get proxy
npm config get https-proxy

删除代理

npm config delete proxy
npm config delete https-proxy