你在网页版使用 Codex 时,网络路径通常会经过托管代理层。
如果出现 CONNECT tunnel failed, response 403,常见不是仓库权限问题,而是“出站代理策略”拦截。
-
平台侧出站代理策略未放通 github.com:443
- 现象:
curl与git ls-remote https://github.com/...都报 403。
- 现象:
-
环境变量里有代理设置,且代理拒绝目标域名
- 现象:
env中存在HTTP_PROXY/HTTPS_PROXY/ALL_PROXY,请求都走代理。
- 现象:
-
git 配置层有代理(global/system/local),覆盖了环境设置
- 现象:即使清空 env,git 仍通过代理访问。
-
SSH 通道被封(22 端口不可达)
- 现象:
ssh -T [email protected]报Network is unreachable。
- 现象:
-
容器网络策略是“白名单域名”模式
- 现象:部分网站可访问,但 GitHub 相关域名被拒。
env | grep -Ei 'http_proxy|https_proxy|all_proxy|no_proxy'用途:查看当前 shell 是否注入代理环境变量。
git config --show-origin --get-regexp 'http\..*proxy|https\..*proxy'用途:查看 git 在 system/global/local 哪一层配置了代理。
unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY ALL_PROXY all_proxy用途:仅当前终端会话临时禁用代理变量。
curl -I https://github.com --max-time 10用途:测试 HTTPS 基础连通性。
git ls-remote https://github.com/TANFLESS/mm.git HEAD用途:测试 git over HTTPS 到目标仓库是否可达。
git config --global --unset http.proxy
git config --global --unset https.proxy用途:删除全局 git 代理配置。
git config --unset http.proxy
git config --unset https.proxy用途:删除当前仓库级 git 代理配置。
cd /workspace/mm
git remote -v用途:检查 origin 地址是否正确。
git fetch origin
git branch --set-upstream-to=origin/main work
git pull --rebase用途:拉取远端并设置分支跟踪关系。
ssh -T [email protected]
git remote set-url origin [email protected]:TANFLESS/mm.git
git fetch origin用途:改走 SSH 通道访问仓库。