Are you sure you’re cloning over SSH?
Run git remote -v. The output below is from a repository that clones via HTTPS: notice the https:// URL scheme.
origin https://github.com/git/git.git (fetch)
origin https://github.com/git/git.git (push)
Clone URLs for SSH will have one of two forms:
username@host.domain.tld:foo/bar/baz.git
ssh://username@host.domain.tld/foo/bar/baz.git
Assuming your host supports both SSH and HTTPS (as GitHub, GitLab, and Gitorious do), then simply change the remote’s URL rather than recloning the entire history.
git remote set-url origin git@host.domain.com:foo/bar/baz.git
Different hosts will have different URL designs. For example, switch the above GitHub URL from HTTPS to SSH with
git remote set-url git@github.com:git/git.git
GitHub has a related guide for changing a git remote’s URL.
Windows
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 va
answered 2010-09-02T14:42:42.883