- HTTP 形式:
git clone https://github.com/owner/git.git
- SSH 形式:
git clone [email protected]:owner/git.git
git config --global http.proxy "http://127.0.0.1:8080"
git config --global https.proxy "http://127.0.0.1:8080"
git config --global http.proxy "socks5://127.0.0.1:1080"
git config --global https.proxy "socks5://127.0.0.1:1080"
git config --global --unset http.proxy
git config --global --unset https.proxy
修改 ~/.ssh/config
文件(不存在则新建):
# 必须是 github.com
Host github.com
HostName github.com
User git
# 走 HTTP 代理
# ProxyCommand socat - PROXY:127.0.0.1:%h:%p,proxyport=8080
# 走 socks5 代理(如 Shadowsocks)
# ProxyCommand nc -v -x 127.0.0.1:1080 %h %p
今天在mac上使用ssh登录莫名其妙出现以下问题: kex_exchange_identification: Connection closed by remote host Connection closed by UNKNOWN port 65535
cd ~/.ssh
rm -rf known_hosts
#~/.ssh/config
# 必须是 github.com
Host github.com
HostName ssh.github.com
IdentityFile /Users/xxx/.ssh/github_id_rsa
User git
Port 443
# 走 HTTP 代理
# ProxyCommand socat - PROXY:127.0.0.1:%h:%p,proxyport=8080
# 走 socks5 代理(如 Shadowsocks)
ProxyCommand nc -v -x 127.0.0.1:7890 %h %p
如何在同一电脑上生成配置多个ssh key 公钥 私钥:https://blog.csdn.net/qq_55558061/article/details/124117445
可以生成github专用的github_id_rsa