美文网首页
github拉取和上传网络超时问题

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

作者: 阿鲁提尔 | 来源:发表于2025-08-13 11:07 被阅读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(避免直连模式影响代理生效)

相关文章

网友评论

      本文标题:github拉取和上传网络超时问题

      本文链接:https://www.haomeiwen.com/subject/mefiojtx.html