Background:

Today, an error was reported when I used the IDEA to pull the project on Github in SSH mode on the company computer:

Could not read from remote repository

Check online and it is useless to change SSH executable to Native

In the end, the problem was that the SSH key was incorrectly configured. Therefore, the SSH key was reconfigured and the problem was solved.

 

Detailed steps:

1. Find the.ssh directory on drive C and delete it (if there is one)

2. Use Git Bash to regenerate the SSH key

$CD ~ # Ensure that the current path is in "~" $ssh-keygen -t rsa -c "[email protected]" Enter file in which to save the key (/c/Users/xxxx_000/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Your public key has been saved in /c/Users/xxxx_000/. SSH /id_rsa In /c/Users/xxxx_000/. SSH /id_rsa.pub. e3:51:33:xx:xx:xx:xx:xxx:61:28:83:e2:81 [email protected]Copy the code

3. Add the public key content of id_rsa.pub in the newly generated.

4. Configure your account using Git Bash

$git config --global user.name "your_username" $git config --global user.email "your_registered_github_Email" Set email address (recommended to register giuHub email)Copy the code

5. Test

$SSH -t [email protected] The authenticity of host 'github.com (192.30.252.129)' can't be established. RSA key fingerprint Man is up: xx: xx: xx: xx: xx: 4 d: eb: df: a6:48. Are you sure you want to continue connecting (yes/no)? Yes # to confirm whether you continue to contact, Enter yes Warning: Permanently added 'github.com, 192.30.252.129' (RSA) to the list of known hosts. Hi XXX! You have successfully authenticated, but GitHub does not provide shell access.Copy the code

6. Then use IDEA to pull the project will not report an error