切换暗色
GitHub 访问加速与 Git 操作:网页能打开时怎样排查终端拉取超时
先找检查方向
遇到的情况:网页可以打开,终端拉取代码却失败,应该查哪里?
先检查 Git 的代理设置是否与本地客户端一致。下方 PORT 须替换为客户端实际监听端口:
另一条检查路径是客户端的 TUN 接管设置,确认终端连接是否被接入。
git config --global http.proxy 'http://localhost:PORT'另一条检查路径是客户端的 TUN 接管设置,确认终端连接是否被接入。
💻 对照本地监听设置 Git
bash
# 将 PORT 换成客户端实际监听端口,再执行命令
git config --global http.proxy 'http://localhost:PORT'
git config --global https.proxy 'http://localhost:PORT'
# 不再使用此设置时,移除对应的全局代理项
git config --global --unset http.proxy
git config --global --unset https.proxy