如何给 SourceTree 访问 Github 时设置代理?
内容
显示目录
最近 Github 访问是越来越慢了,连续 pull push 都超时失败。
就打算给 SourceTree 设置一下代理。
搜索了下,Mac 版的 SourceTree 并没有设置代理的配置,因此要想走代理,可以直接从 Git 的配置下手。
1. 移除当前 Git 全局配置代理
git config --global --unset http.proxy
git config --global --unset https.proxy
2. 查看信息 Git 配置信息
git config --global -l
3. 重新为 Git 设置代理
git config --global http.proxy 'socks5://127.0.0.1:1080'
git config --global https.proxy 'socks5://127.0.0.1:1080'
4. 再次查看 gitconfig 的配置
使用如下命令再次查看配置文件
cat ~/.gitconfig
会发现多出了这两行
[http]
proxy = socks5://127.0.0.1:1080
[https]
proxy = socks5://127.0.0.1:1080
