# `git@github.com: Permission denied (publickey). fatal: Could not read from remote repository.`

**Dónde aparece:** Terminal

**Qué significa:** Git intentó conectarse a GitHub usando claves SSH en lugar de tu conexión HTTPS iniciada con GitHub CLI.

## Causas probables

- La dirección remota del repositorio empieza por `git@github.com:` en lugar de `https://github.com/`.
- Se ejecutó `gh auth login` eligiendo SSH en lugar de HTTPS.

## Mensaje para tu agente

```text
Git falló con `Permission denied (publickey)`. Cambia la URL remota del repositorio a HTTPS y ejecuta `gh auth setup-git` para que Git use mi sesión de GitHub CLI.
```

**Cómo evitarlo:** Elige siempre HTTPS (no SSH) cuando ejecutes `gh auth login`.

---
Fuente: [Agentic Makers](https://agenticmakers.app/es/ayuda/errores/git-permiso-denegado-publickey) · Licencia: CC BY 4.0
