Configure Git With Existing Keys

I've set up git with a public and private key. I sent my public key to the server. Then I formatted my computer and installed windows again. But I saved both keys on my hard drive before formatting. Now I want to reconfigure my git with existing keys. How can i do this????

+1


source to share


1 answer


You just need to copy your id_rsa

and id_rsa.pub

keys (which you previously saved) to C:\Users\YourAccount\.ssh

(create a directory " .ssh

" if it doesn't exist).



This path is git-cmd.bat

(in msysgit ) defines in %HOME%

, and ssh needs to look for your keys in %HOME%/.ssh

.
Note that it is important to HOME

be defined by the msysgit session (a cmd

or git-bash

), as the OS itself never defines an environment variable HOME

(it uses instead USERPROFILE

, which ssh knows nothing about).

+1


source







All Articles