I have configured git with public and private key. I sent my public key to server guy.

Then I formatted my PC and installed windows again. But I saved my both keys on the hard drive before formatting system.

Now I want to reconfigure my Git using existing keys.

How can I do this????

解决方案

You simply need to copy your id_rsa and id_rsa.pub keys (that you previously saved) in C:\Users\YourAccount\.ssh (create the directory '.ssh' if it doesn't exist).

That path is what git-cmd.bat (in msysgit) defines at %HOME%, and ssh needs to look for your keys in %HOME%/.ssh.

Note that it is important for HOME to be defined by a msysgit session (a cmd or a git-bash), because Windows itself never defines the environment variable HOME (it uses USERPROFILE instead, which ssh known nothing about).

Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐