[git uses ssh protocol to push and pull code and reports error] ssh: connect to host gitlab.com port 10012: Connection refused

Problem background

I have been using the ssh protocol to push and pull the code. Later, because I changed computers and migrated the data from the old computer to the new computer, the above error occurred when I used ssh to manage the project.

I tried two common solutions on the Internet, but neither worked.

  • 1. I first reconfigured ssh on the new computer according to the online tutorial, deleted the original SSH Keys and generated a new public key, and then reconfigured it. The result still didn't work.

Insert image description here
This solution does not work, and an error is still reported.

    1. The second solution is to modify the ssh configuration file (most of the solutions on the Internet are this, I don’t know if it is really useful, mine is useless anyway)

Insert image description here
Still not working, but there is still no problem using the ssh protocol to push the code using an old computer. It stands to reason that the data on the two computers is the same and there will be no configuration problems. asked

solution

After searching various solutions on the Internet, I came to the conclusion that the ssh port number was rejected, and it should have been banned by the company's firewall. (But the old computer always uses ssh). I'm too lazy to find someone to confirm, so I gave up ssh and switched to http protocol directly.

Insert image description here

The simplest way is to delete the project that was originally cloned using the ssh protocol, then re-clone the project using the http protocol, and then perform push and pull operations on the project. It is recommended that when you encounter a problem, don't be stubborn. Change your thinking and think that the sky is brighter. Maybe this means that choice is greater than effort.

Guess you like

Origin blog.csdn.net/maligebilaowang/article/details/131530010