I've looked through several of Q&As about why git asks for an SSH key passphrase every time, but I haven't found one that describes my situation. What makes my situation different is that I have successfully created an ssh key, added it to the agent, and the agent is running. So when I run:
ssh -T git@github.com
I immediately get the success message "You've successfully authenticated, but GitHub does not provide shell access." It does not ask for a passphrase.
The perplexing thing is that in powershell when I navigate to a git repo associated with that account, and run a git command like this:
cd ~/mygitrepo
git fetch
I get asked to Enter passphrase for key 'C:\Users\me\.ssh\github'.
If I enter the passphrase, I successfully can fetch from the repo.
Why am I asked to enter the passphrase when running a git command but not when running an ssh command?
Extra details
I'm running Windows 10, using PowerShell inside Windows Terminal. I use ssh everyday to connect to various remotes and it never asks for a passphrase.
Snippet from ~/.ssh/config
Host github.com
HostName github.com
User git
IdentityFile C:\Users\me\.ssh\github
Snippet from ~/mygitrepo/.git/config
[remote "origin"]
url = git@github.com:myuser/myrepo.git