编程知识 cdmana.com

How to solve the operation timed out in Git push / pull operation

lately git push Often appear Operation timed out, The details are as follows :

$ git push origin 72
ssh_dispatch_run_fatal: Connection to 192.30.255.112 port 22: Operation timed out
fatal: Could not read from remote repository.

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

mean : Connecting to the remote address 22 Port timeout , Then check the permissions and the existence of the remote repository .

First of all, you can access the warehouse on the web , So the question is not in the hint Permissions or remote repositories .

Solution steps

View remote warehouse address

Check out the... Under the project .git/config file , Be careful .git A folder is a hidden folder .

[remote "origin"]
        url = git@github.com:yunzhiclub/xxxx.git
        fetch = +refs/heads/*:refs/remotes/origin/*

The address of the remote warehouse is github.com

SSH

$ ssh github.com
panjie@github.com: Permission denied (publickey).

Prompt permission does not allow , Make sure the network can access the remote host 22 port . If you can't access , So we need to find the reason on the Internet . First, let's see if we can ping through , If you can ping through , It depends on whether the firewall policy is disabled ssh Connect or 22 port .

ping

There's no problem with the Internet , The problem should be in the certificate .

ping github.com
panjieIMacdeiMac:app panjie$ ping github.com
PING github.com (192.30.255.112): 56 data bytes
64 bytes from 192.30.255.112: icmp_seq=0 ttl=36 time=297.969 ms

obtain github.com Of ip The address is 192.30.255.112.

vi ~/.git/known_hosts

find github.com,xx.xx.xxx.xxx One of , Find out xx.xx.xxx.xxx And 192.30.255.112 Don't agree with each other , Delete .

Problem solving .

summary

git It may be caused by the following reasons :

  1. The warehouse does not exist or does not have permission . verification : Login on the web .
  2. Network problems . verification :ping It doesn't work .
  3. ssh Or port problem . verification :ssh github.com, See the prompt is network error or permission not allowed .
  4. Certificate problem : verification : contrast ~/.ssh/known_hosts Medium Host name ip Address Whether or not ping The result is the same , Delete if inconsistent .

版权声明
本文为[secrets]所创,转载请带上原文链接,感谢

Scroll to Top