2025-10-24
Git 配置PAT
2025-10-24 ~ 2025-10-24

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.

2025-10-24
Proxy set, but ssh -T git@github.com still fails
2025-10-24 ~ 2026-01-01

The note is generated by ChatGPT.

Observation — Proxy set, but SSH still fails

Although you set http_proxy / https_proxy (or all_proxy), running:

1
ssh -T git@github.com

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.

2025-10-17
Git配置SSH Key
2025-10-17 ~ 2025-10-17

The note is generated by 豆包.

一、配置目的

通过 SSH Key 实现与远程仓库(GitHub/GitLab/Gitee 等)的无密码安全连接,避免每次操作远程仓库时重复输入账号密码。

二、操作步骤

1. 检查本地是否已存在 SSH Key

首先确认本地是否已有生成好的 SSH Key,避免重复创建。

2025-10-06
为Git配置代理
2025-10-06 ~ 2025-10-06

❗️The note is generated by DeepSeek.

🔧 配置 Git 使用 HTTP 代理

您可以通过 Git 命令行来设置全局的 HTTP 和 HTTPS 代理。

  1. 设置全局代理
    打开终端(例如 Windows 的 Git Bash、macOS 的 Terminal 或 Linux 的 Shell),执行以下命令:

2025-08-25
Git常用命令
2025-08-25 ~ 2025-08-25
  1. 删除对一个文件的追踪

    • command:
    1
    2
    3
    
    git rm --cached 'file_name'
    # 如果是一个folder则加上参数'-r'
    # --cached会保留本地文件,如不需保留则可省略该参数。
    
    • 如果希望该文件以后不再被 Git 追踪,可以将其添加到 .gitignore 文件中,避免误提交:
    1
    
    echo "file_name" >> .gitignore
    
  2. 本地分支改名: