After I click the push button in the “Source Control” panel, I need to input the passphrase multiple times, usually 2 times, but even reach 3 times sometimes.
This never happened when I use the terminal to push the code
This is most likely the Sync Changes button. After a commit, the main button in Source Control becomes “Sync Changes”, which runs a pull and then a push (two connections), plus a fetch if git.fetchOnPull is on (three). Your key isn’t held by an SSH agent, so every connection asks for the passphrase again. A terminal git push is a single connection, which is why it only asks once.
The cleanest fix on Windows is to let the Windows OpenSSH agent hold the key:
In an admin PowerShell: Get-Service ssh-agent | Set-Service -StartupType Automatic then Start-Service ssh-agent
In a normal PowerShell: ssh-add $env:USERPROFILE\.ssh\id_ed25519 (use your key’s file name) and enter the passphrase once
Point git at Windows OpenSSH so it uses that agent: git config --global core.sshCommand "C:/Windows/System32/OpenSSH/ssh.exe"
Restart Cursor and push again. It should no longer ask.
If you’d rather not use an agent, use Push from the ... menu in Source Control instead of Sync Changes (one prompt), and check that git.fetchOnPull and git.autofetch are off in Settings.
If you’re already using Push and still see 2-3 prompts, let me know and we’ll dig further.