git指定网址使用代理

指定网址

1vim ~/.gitconfig
2[http "https://github.com"]
3    proxy = socks5://127.0.0.1:1080

设置代理

如果你有国外云主机的话可用ssh搭建临时通道

1ssh -N -f -D 0.0.0.0:1080 -p 22 root@192.168.xx.xxx

设置免密登录

11.进入.ssh目录: cd ~/.ssh
22.生成一对密钥: ssh-keygen -t rsa
33.发送公钥:     ssh-copy-id -p 22 root@192.168.xx.xxx
44.免密登录测试: ssh -p 22 root@192.168.xx.xxx

发布日期:2023-03-09 23:18 字数:37 用时 1分钟
tags:git