返回

使用代理设置 Git 克隆

   
摘要GPT
摘要小助理暂时失联跑路啦……😜

git clone ssh 走代理

新建一个 C:\Users\你的用户名\.ssh\config 文件(没有扩展名,如果已存在此文件则不用新建),编辑此文件增加以下内容:

Host github.com *.github.com  
    User git  
    ProxyCommand connect -S 127.0.0.1:7890 %h %p

其中 Host 右边为需要走代理的域名列表,127.0.0.1:7890 替换为自己的代理服务器地址。

git clone http(s) 走代理

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

其中 127.0.0.1:7890 替换为自己的代理服务器地址。

知识共享许可证 CC BY-NC-SA 4.0
最后更新于 2024-07-17 18:28
使用 Hugo 构建
主题 hugo-magic小洋葱 魔改 由 Jimmy 设计
Written by Human, Not by AI