Git配置代理
国内网络间歇性无法同步”Github”仓库与”Hexo”博客,由于”Git”本身没有代理,所以需要添加。网上教程看了一圈都有误导,正确配置教程如下:
step 1、 命令行添加代理
1 | git config --global http.proxy socks5://127.0.0.1:10808 |
Windows代理端口一般是1080,这里我用的是V2RayN,代理端口是10808,注意修改成你自己的。
step 2、 查看所有代理
1 | git config --global --list |
返回结果如下,可以看到已经代理成功,push飞快:
1 | core.editor="C:\Users\田豆豆\AppData\Local\Programs\Microsoft VS Code\Code.exe" --wait |
step 3、 取消代理
1 | git config --global --unset http.proxy |