The git bash following error may occur when you do not use to generate key after installing git under windows
Microsoft Windows [Version 6.3.9600](C) 2013 Microsoft Corporation。 All rights reserved.C:\users\loftor>Ssh-KeygenGenerating Public/PrivateRSA Key Pair.EnterFileInchWhich to save the key(. Ssh/id_rsa):Could NotCreate directory'//.ssh ': no such file or Directoryenter passphrase ( Empty for no Passphrase ): enter same passphrase Again: open //.ssh/id_rsa failed:no such host or network Path.saving the key failed: / /.ssh/id_rsa. c:\users\loftor>
The reason for this error is that we have not configured the environment variable home the directory, so the directory cannot be found.
So we HOME can solve the problem simply by adding in the environment variable! ~
C:\users\loftor>Ssh-KeygenGenerating Public/PrivateRSA Key Pair.EnterFileInchWhich to save the key(/c/Users/Loftor/.Ssh/Id_rsa):CreatedDirectory'/c/users/loftor/.ssh '.EnterPassphrase(EmptyFor NoPassphrase):EnterSame passphrase again:YourIdentification has been savedInch /C/Users/Loftor/.Ssh/Id_rsa.Your PublicKey has been savedInch /C/Users/Loftor/.Ssh/Id_rsa.Pub.TheKey fingerprintIs:04:14:6f:66:3f:f5:71 :d0:d7: 36:82:c6 :09:94: fe:45 [email Protected]-pcthe Key s Randomart image is:+--[RSA 2048]----+|. +. o+ o ... | | O. = E o=| | B. o o.+| | = O. o O | | S +. . || O | | || || |+-----------------+c:\users\loftor>
Window set cmd and Gitbash consistent