github clone Failed to connect to github.com port 443 after xxx ms

简介: github clone Failed to connect to github.com port 443 after xxx ms

最近克隆github项目时老是报超时,可以尝试以下解决方法
如果本地开启了代理还是clone超时,可以尝试最后一种方式解决

1、把 https 换成 http,如:

git clone http:xxx

2、更新本地hosts配置,可以参考这篇文章获取最新的hosts

C:\Windows\System32\drivers\etc\hosts
ipconfig /flushdns

解决github图片及网页加载不出来

3、 将通信协议由 http/2 改为 http/1.1

git config --global http.version HTTP/1.1
  • 改回来:

    git config --global http.version HTTP/2
    

    4、如果本地开启了代理也还是报超时,可以把git代理地址设置下,使用如下命令,其中 127.0.0.1 是代理URL,1080是端口

git config --global http.proxy 127.0.0.1:1080
  • 查询是否使用代理:
git config --global http.proxy
  • 取消代理设置:
git config --global --unset http.proxy
git config --global --unset https.proxy
  • 或者在配置文件中修改代理:
Windows路径:C:\Users\Administrator\.gitconfig
Linux路径: ~/.gitconfig
[http]
    version = HTTP/1.1
    proxy = 127.0.0.1:1080
目录
相关文章
|
网络协议 Shell 网络安全
ssh: connect to host github.com port 22: Connection refused
本文讨论了在使用Git命令操作GitHub时遇到的"ssh: connect to host github.com port 22: Connection refused"错误,分析了可能的原因,并提供了使用443端口或https协议作为解决方案,最终确定问题是由于DNS解析错误导致,通过修改hosts文件解决。
ssh: connect to host github.com port 22: Connection refused
|
网络协议 Shell 网络安全
开发工具使用之 github 私人仓库Clone 失败的问题
这篇文章介绍了解决GitHub上私人仓库克隆失败的问题,通过检查本地SSH key的存在与否、生成新的SSH key、添加SSH key到GitHub以及使用SSH方式克隆私有仓库的步骤来解决这个问题。
开发工具使用之 github 私人仓库Clone 失败的问题
|
网络安全 开发工具 git
【git】解决git报错:ssh:connect to host github.com port 22: Connection timed out 亲测有效
【git】解决git报错:ssh:connect to host github.com port 22: Connection timed out 亲测有效
5338 1
|
开发工具 git
【已解决】error: failed to push some refs to ‘git@github.com:BATdalao/Github-green.git‘
【已解决】error: failed to push some refs to ‘git@github.com:BATdalao/Github-green.git‘
|
开发工具 git
出现“error: failed to push some refs to ‘https://github.com/****.git‘”,如何解决问题
出现“error: failed to push some refs to ‘https://github.com/****.git‘”,如何解决问题
2264 1
|
Web App开发 缓存 开发工具
Failed to connect to github.com port 443: Operation timed out和弹出无法打开"GoogleSoftwareUpdate.bundle"
Failed to connect to github.com port 443: Operation timed out和弹出无法打开"GoogleSoftwareUpdate.bundle"
401 2
|
3月前
|
JSON Kubernetes 安全
找到啦,我们已上车,Github 27000+ star,研发团队必备开源工具项目,真丝滑!!!
Trivy 是一款高效灵活的开源安全扫描工具,支持容器镜像、文件系统、Kubernetes 等多目标扫描,具备快速、易用、集成性强等特点,适用于 DevSecOps 全流程安全检测。
159 0
|
2月前
|
人工智能 JavaScript 前端开发
Github 2024-10-28 开源项目周报 Top15
本周GitHub热门项目涵盖Svelte、Open Interpreter、PowerShell等,涉及Web开发、AI助手、自动化工具等领域,Python、JavaScript为主流语言,展现开源技术活跃生态。(239字)
416 19
|
2月前
|
人工智能 JavaScript 前端开发
Github 2024-11-04 开源项目周报 Top14
本周GitHub热门项目涵盖屏幕截图转代码、网页监控、低代码开发等。Python与TypeScript主导,亮点项目包括AI生成代码工具、开源社交应用Bluesky及机器人框架LeRobot,展现AI与自动化技术的快速发展趋势。
196 15