如果可以更推荐用 socket 作为 git 代理,在最新版本 clash verge,用 http 经常又 https 证书问题
git config --global http.proxy 127.0.0.1:7890
git config --global https.proxy 127.0.0.1:7890
# 其他端口自行设定
git config --global http.proxy 127.0.0.1:7891
git config --global https.proxy 127.0.0.1:7891
7890 是我们代理软件的端口。
# 查看
git config --list
# 编辑
git config --global -e
git config --global http.proxy 'socks5://127.0.0.1:7890'
git config --global https.proxy 'socks5://127.0.0.1:7890'
git config --global --unset http.proxy
git config --global --unset https.proxy
git config --global --get http.proxy
git config --global --get https.proxy
修改C:\\Users\\${your username}\\.ssh目录下的config文件,若没有则新建
Host github.com
Hostname ssh.github.com
Port 443
User git
ProxyCommand connect -S 127.0.0.1:7890 %h %p
例如Linux、MacOS、Windows的Wsl2等等
修改~/.ssh目录下的config文件,若没有则新建