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

**Where it appears:** Terminal

**What it means:** Git tried to connect to GitHub using SSH keys instead of your signed-in GitHub CLI HTTPS connection.

## Likely causes

- The repository remote URL starts with `git@github.com:` instead of `https://github.com/`.
- `gh auth login` was run with SSH selected instead of HTTPS.

## Message for your agent

```text
Git failed with `Permission denied (publickey)`. Switch our repo's remote URL to HTTPS and run `gh auth setup-git` so Git uses my GitHub CLI login.
```

**Prevention:** Always choose HTTPS (not SSH) when running `gh auth login`.

---
Source: [Agentic Makers](https://agenticmakers.app/en/help/errors/git-permission-denied-publickey) · License: CC BY 4.0
