On Unix-like platforms, the fix is straightforward. If ssh-agent
isn't running, start it with, for example
$ eval `ssh-agent`
and then add your default identity with
$ ssh-add
If you have an identity somewhere else, run
$ ssh-add /path/to/other/ssh_id
On Windows, a typical setup uses PuTTY as the SSH client, which means you'll want to run Pageant, PuTTY's SSH agent. On Windows, I run a quick batch job out of the Startup group:
@echo off
start /b "C:\Program Files\PuTTY\pageant.exe" "C:\Users\Greg\Greg.ppk"
where Greg.ppk
is a key that I created with PuTTYgen.
One more step: tell git to use plink, PuTTY's client for non-interactive connections. Set the environment variable GIT_SSH
to
C:\Program Files\PuTTY\plink.exe
assuming that's where PuTTY lives.
If you're still having trouble, GitHub has a page for troubleshooting issues with GitHub and SSH, but please also update your question so we can make this a more helpful resource.