# ERROR: Command errored out with exit status 128: git clone --filter=blob:none 'git@github.com:user/private-repo.git' /tmp/pip-req-build-xxxxx. Check the logs for full command output. Permission denied (publickey).

- **ID:** `pip/git-clone-ssh-permission-denied`
- **Domain:** pip
- **Category:** auth_error
- **Error Code:** `ERROR`
- **Verification:** ai_generated
- **Fix Rate:** 85%

## Root Cause

pip is trying to clone a private Git repository via SSH, but the SSH key is not configured or not accepted by the remote host (e.g., GitHub).

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| pip 22.3 | active | — | — |
| pip 23.0 | active | — | — |
| pip 23.2 | active | — | — |
| git 2.30 | active | — | — |
| git 2.40 | active | — | — |

## Workarounds

1. **Ensure SSH key is added to ssh-agent: eval $(ssh-agent -s) && ssh-add ~/.ssh/id_rsa** (90% success)
   ```
   Ensure SSH key is added to ssh-agent: eval $(ssh-agent -s) && ssh-add ~/.ssh/id_rsa
   ```
2. **Use a personal access token with HTTPS: pip install git+https://<token>@github.com/user/private-repo.git** (95% success)
   ```
   Use a personal access token with HTTPS: pip install git+https://<token>@github.com/user/private-repo.git
   ```
3. **Clone the repo manually first, then install from local: git clone git@github.com:user/private-repo.git && pip install ./private-repo** (90% success)
   ```
   Clone the repo manually first, then install from local: git clone git@github.com:user/private-repo.git && pip install ./private-repo
   ```

## Dead Ends

- **** — HTTPS often requires username/password or token, which may not be available in the pip environment; also fails with authentication errors. (70% fail)
- **** — Cache clearing does not affect SSH authentication; the clone will still fail. (100% fail)
- **** — This is equivalent to the original; same SSH key issue persists. (100% fail)
