from Git for Windows home
Use the following options:
- Run Git and included Unix tools from the Windows Command Prompt
- Use OpenSSH
In order to allow OpenSSH to find your keys in the default location $HOME/.ssh/id_rsa its required to set the $HOME environment variable.
set HOME=%USERPROFILE%
c:\ssh-keygen -t rsa -C "[email protected]“
You will be prompted for a file name:
Enter file in which to save the key (/c/Users/YOUR_USER_NAME/.ssh/id_rsa):
ATTENTION:
- If the suggested path is //.ssh/id_rsa most probably the environment variable HOME is missing on your system. Fix: set HOME=%USERPROFILE%
- Use Unix style path syntax /c/Users/YOUR_USER_NAME/.ssh/id_rsa instead of Windows style c:\users\YOUR_USER_NAME.ssh\id_rsa
- The directory (.ssh) whereto the keyes should be created should exist. But the key file should not exist.
- Open the public key file file c:\users\YOUR_USER_NAME.ssh\id_rsa.pub in a text editor
- Open the open the SSH section of your GitHub settings https://github.com/settings/ssh.
- Press Add SSH key
- Copy the whole text of the id_rsa.pub from the editor into the key text area and finish with Add key