Windows: How to Solve Git Pull Error

Error content:

Unable to negotiate with x.x.x.x port 22: no matching host key type found. Their offer: ssh-rsa
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

The public key of Windows computer has been added to the server. At first, it can be used normally, but suddenly, the code cannot be updated on windows.


C:\users\administrator\.SSH (this is the path on my computer. Your computer path may be different. Find it according to the specific situation)

Add a new file config in this directory. The file content is:

Host x.x.x.x
    HostkeyAlgorithms +ssh-rsa
    PubkeyAcceptedAlgorithms +ssh-rsa

Note that x.x.x.x here represents the IP address of your git server.

Pull the code again and restore it.

Similar Posts: