github拉取和上传网络超时问题

2025-08-13  本文已影响0人  阿鲁提尔

Clash Verge 可以用于配置 Git 代理,具体方法如下:

1. HTTPS 代理设置

在 Clash Verge 中启用代理后,通过以下命令为 Git 配置 HTTPS 代理(假设代理端口为 7890):

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

若需移除代理,执行:

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

2. SSH 代理设置

编辑 ~/.ssh/config 文件(Windows 路径为 C:\Users\<用户名>\.ssh\config),添加以下内容:

Copy Code
Host github.com
  ProxyCommand connect -S 127.0.0.1:7890 %h %p

此配置会通过 Clash Verge 的 SOCKS5 代理(默认端口 7890)中转 SSH 流量

3. 注意事项

确保 Clash Verge 的代理模式为 Global 或 Rule(避免直连模式影响代理生效)

上一篇 下一篇

猜你喜欢

热点阅读