一、通过命令行(方法一)
设置代理:

git config --global http.proxy http://127.0.0.1:1080

git config --global https.proxy http://127.0.0.1:1080

取消代理:

git config --global --unset http.proxy

git config --global --unset https.proxy

二、通过修改配置文件方式(方法二)
C:\Users\当前用户名.gitconfig
用任何文本编辑器,打开如上文件,修改文本内容如下:

[https]
    proxy = 'socks5://127.0.0.1:1080'
[http]
    proxy = 'socks5://127.0.0.1:1080'
Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐