问题出现的原因:

DNS服务器数据不同步,github的服务器发送迁移,在本地缓存的ip地址现在无效了。

解决方案:

1)点击这里,查询github.com最新的ip地址

2.0)编辑linux系统地址缓存文件:

root@iZwz99zhkxxl5h6ecbm2xwZ:~/teapot# cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 Aliyun

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
# 添加1条github.com 的ip地址缓存项
140.82.116.3 github.com
root@iZwz99zhkxxl5h6ecbm2xwZ:~/teapot#

2.1)编辑windows系统网络缓存文件:

C:\Windows\System32\drivers\etc

github提交不上去,网络超时问题解决_github


编辑hosts文件,不存在则创建,不要带任何缀名,文件名就叫hosts,可以用git bash命令创建文件:touch hosts

140.82.116.3 github.com

github提交不上去,网络超时问题解决_缓存文件_02


按照上述操作之后,git push就正常了。