I am running Git 1.9.4 on my Windows 8. My OS is installed on a SSD. My Git installation is located on another hard drive. I'm pretty new to git. How does Git choose where to put the .ssh folder for private and public keys? My home directory is on C: but Git is installed on D:. Does Git recognize (for example when pushing) that there is a .ssh folder, although its located in another path then it would usually be?
Asked
Active
Viewed 1.6k times
2 Answers
2
How does Git choose where to put the
.ssh
folder
If you run git through git-cmd.bat
, it will look for ssh keys in %HOME%/.ssh
.
HOME
is defined in git-cmd.bat
(by default: %USERPROFILE%
)
As long as HOME is set (to any folder you want), Git will use it (even if it is installed on another drive).
You will use ssh-keygen
to generate your public/private keys.
The same applies for git bash
: the keys will be in ~/.ssh
.
-
Simply do `cd ; start .` in git bash to open an explorer in that folder. – Stefan Näwe Oct 07 '14 at 10:50
1
This answer definitely led me on the right track.
Using the command ssh-keygen -t rsa -C "your_email@example.com"
is correct.
Git will create this .ssh folder under %HOME%/.ssh as stated, but only if you do not define a file yourself, such as key.txt for example. This guide really helped me: Generating SSH keys

user3605638
- 207
- 1
- 5
- 11