10

I've installed PoshGit and I've set up my RSA key with github and in my ~\.ssh folder, but PowerShell still prompts me to enter a passphrase on every pull/push. I've followed all the instructions given here. My powershell profile looks like so:

$env:path += ";" + (Get-Item "Env:ProgramFiles(x86)").Value + "\Git\bin"
. 'C:\Users\Caleb\Documents\WindowsPowerShell\Modules\posh-git\profile.example.ps1'
cd ~\Documents\GitHub\travefy

Here's what happens. How do I get it to only ask me on startup?

enter image description here

Caleb Jares
  • 6,163
  • 6
  • 56
  • 83

2 Answers2

6

It turns out I need to run

> ssh-add

I'm not sure why this wasn't mentioned in any of the docs on github.com.

Caleb Jares
  • 6,163
  • 6
  • 56
  • 83
  • Interesting... the last thing `Start-SshAgent` (called by default in the example profile) does is `Add-SshKey`, which should call `ssh-add` for you. Could you open an issue on GitHub for this? – dahlbyk May 11 '13 at 11:26
  • 7
    I realize this is old, but I'm having the same problem and it's not related to `ssh-add`. In fact, I can verify my ssh keys are working with ssh and ssh-agent. `ssh -T git@github.com` works as expected and `ssh-add -l` shows my key is loaded. But `git pull` prompts for the key pasphrase every time. I'm stumped. – user24601 Sep 29 '15 at 02:04
  • You need to get the ssh-agent to run in Powershell by using the command that comes bundled with Git for Windows, see here: https://stackoverflow.com/a/55153372/1548601 – Entalpi Nov 18 '21 at 10:05
5

May you need to configure Git to use the Windows 10 implementation of OpenSSH by issuing the following command in Powershell:

git config --global core.sshCommand C:/Windows/System32/OpenSSH/ssh.exe

This worked for me. Source: danieldogeanu.

pascalre
  • 305
  • 1
  • 4
  • 20