因

git 操作时常因为网络问题无法访问到目标仓库。

果

在用户目录中的 git 配置文件 .gitconfig 中新增:

1
2
[http "https://github.com"]
proxy = http://192.168.47.1:8001

旨在当我们使用 git 客户端访问 https://github.com 中的仓库时会通过配置的 http://192.168.47.1:8001。
这样只会对指定的域名生效,简单方便~