# 错误：命令以退出状态 128 失败：git clone --filter=blob:none 'git@github.com:user/private-repo.git' /tmp/pip-req-build-xxxxx。请查看日志获取完整命令输出。

- **ID:** `pip/git-clone-exit-status-128`
- **领域:** pip
- **类别:** auth_error
- **错误码:** `ERROR`
- **验证级别:** ai_generated
- **修复率:** 85%

## 根因

Pip 无法克隆私有 Git 仓库，因为 SSH 密钥或身份验证凭据缺失、无效或未为运行 pip 的用户配置。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| pip 23.0 | active | — | — |
| pip 23.1 | active | — | — |
| pip 23.2 | active | — | — |
| pip 24.0 | active | — | — |

## 解决方案

1. ```
   确保 SSH 密钥已添加到 SSH 代理：运行 'ssh-add ~/.ssh/id_rsa' 并使用 'ssh -T git@github.com' 验证。
   ```
2. ```
   使用个人访问令牌和 HTTPS：将 requirements.txt 中的需求改为 'git+https://<token>@github.com/user/private-repo.git'。
   ```

## 无效尝试

- **** — The underlying issue is the same SSH authentication problem; manual clone will also fail until credentials are fixed. (90% 失败率)
- **** — This can work if a token is provided, but if the token is missing or expired, the error persists. (40% 失败率)
