git 设置全局代理
linux
本文字数:121 字 | 阅读时长 ≈ 1 min

git 设置全局代理

linux
本文字数:121 字 | 阅读时长 ≈ 1 min

一般我们使用 git 进行上传或者下载时会很慢,连接错误,设置好代理以后就会很快,如果用如下命令需要每次都设置代理,很麻烦
git config --global https.proxy http://127.0.0.1:10808
git config --global http.proxy 'socks5://127.0.0.1:10809'

怎么进行一个全局设置呢?

vi ~./gitconfig

# 在文件中编辑如下内容,其中xxxx是端口号
[https]
        proxy = http://127.0.0.1:xxxx
[http]
        proxy = socks5://127.0.0.1:xxxx

5月 06, 2025
4月 06, 2025
ufw