Problem using git on Windows 7 with msysgit and .ssh keys

11

6

I'm using git on my Ubuntu machine with my existing ssh keys.

Now I have to use Git on Windows 7, and need to use the same keypairs.
I have set up msysgit and created an .ssh folder in Users\username\.ssh.
I have copied my keypair from Ubuntu's .ssh folder to this folder.

But when I try to clone the Git repo, it stops and asks for the password.
According to some tutorials, I should have some options during the msysgit installation regarding ssh, but I saw none.
Do you have any suggestions to solve this?

Burre

Posted 2011-03-26T02:13:29.693

Reputation: 113

Answers

13

You need to set your HOME environment variable to whatever directory you selected for creating the .ssh folder (it doesn't have to be necessarily Users\username\).

%HOME% isn't a native environment variable (%HOMEDRIVE%%HOMEPATH% or %USERPROFILE% is), and the mingw Unix-like session of msysgit is entirely based on the $HOME value.

VonC

Posted 2011-03-26T02:13:29.693

Reputation: 13 292

HOMEPATH does not suffice, it should either be %HOMEDRIVE%%HOMEPATH% or %USERPROFILE% – bgerth – 2015-09-28T08:26:15.183

@bgerth Thank you, I have belatedly edited the answer. – VonC – 2015-12-11T09:07:58.090

Thanks, but how do I add this HOME env. variable? – Burre – 2011-03-28T00:20:24.960

@Burre: simply define a User environment variable called HOME in your Windows settings, like described in http://www.itechtalk.com/thread3595.html.

– VonC – 2011-03-28T05:37:49.927