The note is partly generated by “ChatGPT.”
The article “Proxy set, but ssh -T git@github.com still fails” explains that Git SSH cannot use an HTTP proxy and provides a solution. However, in my experience, even using that solution, network performance can be unreliable. Therefore, if you can use HTTPS for Git, I recommend switching from SSH to HTTPS directly. Below is the method to switch to HTTPS and configure a Personal Access Token (PAT) for authentication.
The note is generated by ChatGPT.
Observation — Proxy set, but SSH still fails
Although you set http_proxy / https_proxy (or all_proxy), running:
| |
still times out or fails.
Root cause — SSH does NOT use the HTTP proxy (key point)
Terminal HTTP/SOCKS environment variables affect HTTP/HTTPS-aware programs (curl, wget, git clone https://…, etc.), but OpenSSH does not honor those variables. SSH opens a raw TCP connection and must be explicitly told to use a proxy — otherwise it tries a direct connection and gets blocked by the network/firewall.
The note is generated by 豆包.
一、配置目的
通过 SSH Key 实现与远程仓库(GitHub/GitLab/Gitee 等)的无密码安全连接,避免每次操作远程仓库时重复输入账号密码。
二、操作步骤
1. 检查本地是否已存在 SSH Key
首先确认本地是否已有生成好的 SSH Key,避免重复创建。
❗️The note is generated by DeepSeek.
🔧 配置 Git 使用 HTTP 代理
您可以通过 Git 命令行来设置全局的 HTTP 和 HTTPS 代理。
设置全局代理:
打开终端(例如 Windows 的 Git Bash、macOS 的 Terminal 或 Linux 的 Shell),执行以下命令: