Running git from a Windows Cmd line: Where are the key files?

So, I installed msysgit and successfully executed git from the bash shell.

From the bash shell, I created the keys with ssh-keygen - everything works fine.
The key files are in my %userprofile%\.ssh folder (from the bash shell, this: ~/.ssh ).
I can connect to my server (without me in my case).

Next, I want to be able to run git from the Windows Cmd shell.
Adding c:\msysgit\bin and c:\msysgit\mingw\bin to the search path.
Git works locally just fine: branch, merge, add, commit, check ... working well.

However, an attempt to work with the server fails with an error: ' Permission denied (publickey). ''
It seems that git, when executed from the command line, looks at another place, trying to allocate key files, or another reason why it fails.

+25
git msysgit ssh
May 25 '11 at 15:35
source share
2 answers

To get the mysysgit command line to search for .ssh keys, you need %HOME% point to the directory containing the .ssh folder

Often you can just do

 set HOME=%USERPROFILE% 
+48
May 25 '11 at 15:42
source share

From the Windows DOS file, you must define the %HOME% environment variable.

HOME does not exist by default in a DOS session.
You can set it to %userprofile% , as this is your current setting.
You can also add it to user environment variables to access any DOS session.

+15
May 25 '11 at 15:39
source share



All Articles