新建远程仓库后,在本地使用ng new 创建了一个angular项目,然后分别用使用一下命令推送到远程新建的仓库:
git init
git add .
git commit -m "init project"
git remote add origin "远程仓库http url"
git push origin master

时报错:fatal: unable to access 'https://github.com/SifiaZiwan/ng-myWYY.git/': Failed to connect to github.com port 443 after 21106 ms: Timed out

网上找了取消代理设置的方法:

git config --global http.proxy
git config --global https.proxy

没有解决问题。
后来找到解决办法:https://blog.csdn.net/weixin_45698935/article/details/106599630

我的解决过程:

1.  在C:\Windows\System32\drivers\etc 中使用记事本打开hosts文件
注释了 github 的IP地址和域名的映射,
# Github Start
#192.30.253.118    gist.github.com
#192.30.255.112    github.com
#192.30.255.110    www.github.com
# Github End

2. 输入一下git命令, 问题完美解决!

XXXXX MINGW64 /c/XXX/ng-myWYY (main)
$ git checkout -b dev
Switched to a new branch 'dev'XXXXX MINGW64 /c/XXX/ng-myWYY (dev)
$ git push origin dev
fatal: unable to access 'https://github.com/SifiaZiwan/ng-myWYY.git/': Failed to
connect to github.com port 443 after 21106 ms: Timed outXXXXX MINGW64 /c/XXX/ng-myWYY (dev)
$ git branch -a
* devmainmasterremotes/origin/mainremotes/origin/masterXXXXX MINGW64 /c/XXX/ng-myWYY (dev)
$ git push origin dev
fatal: unable to access 'https://github.com/XXX/ng-myWYY.git/': OpenSSL SSL_read: Connection was reset, errno 10054XXXXX MINGW64 /c/XXX/ng-myWYY (dev)
$ git config --global http.proxyXXXXX MINGW64 /c/XXX/ng-myWYY (dev)
$ git config --global --unset http.proxyXXXXX MINGW64 /c/XXX/ng-myWYY (dev)
$ git config --global --unset https.proxyXXXXX MINGW64 /c/XXX/ng-myWYY (dev)
$ git push origin dev
Enumerating objects: 7, done.
Counting objects: 100% (7/7), done.
Delta compression using up to 8 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 379 bytes | 379.00 KiB/s, done.
Total 4 (delta 3), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (3/3), completed with 3 local objects.
remote:
remote: Create a pull request for 'dev' on GitHub by visiting:
remote:      https://github.com/XXX/ng-myWYY/pull/new/dev
remote:
To https://github.com/XXX/ng-myWYY.git* [new branch]      dev -> devXXXXX MINGW64 /c/XXX/ng-myWYY (dev)
$ git branch -a
* devmainmasterremotes/origin/devremotes/origin/mainremotes/origin/masterXXXXX MINGW64 /c/XXX/ng-myWYY (dev)
$ git checkout main
Switched to branch 'main'
Your branch and 'origin/main' have diverged,
and have 2 and 3 different commits each, respectively.(use "git pull" to merge the remote branch into yours)XXXXX MINGW64 /c/XXX/ng-myWYY (main)
$ git push origin main
To https://github.com/XXX/ng-myWYY.git! [rejected]        main -> main (non-fast-forward)
error: failed to push some refs to 'https://github.com/XXX/ng-myWYY.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.       

git push报错:fatal: unable to access ‘https://XXX.git/‘: Failed toconnect to github.com port 443相关推荐

  1. git push报错:fatal: unable to access ‘https://github.com/***/‘:The requested URL returned error: 403

    前言 又是被自己菜死的一天. 1.报错信息 使用git push命令后,报错信息如下: remote: Permission to *** denied to . fatal: unable to a ...

  2. 【Linux】git clone报错fatal: unable to access ‘https://github.com/xxx.git/‘: Encountered end of file

    目录 1.问题 2.解决 3.参考 1.问题 git clone代码时突然报错...貌似时不时遇到这个问题,这次遇到了准备简单mark下 git clone https://github.com/xx ...

  3. git clone 报错fatal: unable to access ‘https://github.com/xxxx‘: OpenSSL SSL_read

    fatal: unable to access 'https://github.com/xiaohei0131/mc.git/': OpenSSL SSL_read: Connection was r ...

  4. 解决git在push时报错fatal: unable to access ‘https://github.com/sup0C/a.git/‘: errno 10054

    解决git在push时报错fatal: unable to access 'https://github.com/sup0C/a-repository-for--git/': OpenSSL SSL_ ...

  5. 【报错fatal: unable to access ‘https://github解决办法】

    报错fatal: unable to access 'https://github解决办法 方法一:修改host文件 方法二:把命令行里的http改为git重新执行 方法一:修改host文件 把140 ...

  6. git报错fatal: unable to access ‘https://github.com/‘: OpenSSL SSL_read: Connection was reset

    bug描述 fatal: unable to access 'https://github.com/-': OpenSSL SSL_read: Connection was reset, errno ...

  7. git报错fatal: unable to access ‘https://github.com/.......‘: OpenSSL SSL_read: Connection was reset, e

    fatal: unable to access 'https://github.com/-': OpenSSL SSL_read: Connection was reset, errno 10054 ...

  8. git报错”fatal: unable to access ‘https://github.com/defnull/bottle/‘: Empty reply from server“

    问题: fatal: unable to access 'https://github.com/defnull/bottle/': Empty reply from server 解决办法: 将原命令 ...

  9. git命令报错fatal: unable to access

    遇到这个问题不要慌 fatal: unable to access 我遇到的时候以为时没有权限,后来并不是,而是地址的问题 在这里是地址的问题 ,需要把前面的^[[200~h给删掉,但是我删掉后还是报 ...

  10. git commit 报错fatal: unable to access

       解决: #取消http代理 $ git config --global --unset http.proxy #取消https代理 $ git config --global --unset h ...

最新文章

  1. 飞书,助力字节跳动高效成长的神秘引擎
  2. java 容器的嵌套_java界面设计里怎么实现容器嵌套
  3. @Autowired和@Resouce的区别
  4. macOS/MacBook Air设置使用iCloud的APP
  5. 安全的本质--理解CIA和AAA
  6. 19.Linux-USB总线驱动分析
  7. 编程人的「对象」长啥样?
  8. MySQL查询数据表中数据记录(包括多表查询)
  9. hⅰgh怎么读音发音英语_gh的发音规律
  10. 【sklearn第二十六讲】模型评价
  11. Linux的用户和组
  12. 有关于阿里云的历史-阿里云这群疯子
  13. 计算机笔记--【JVM】
  14. 恭贺除夕,没什么才艺展示,就给大家画新年四格小漫画吧 >⌒<
  15. python文件操作(1)
  16. 基于PHP+MySQL动漫周边商城销售网站的开发与设计
  17. 白噪声检验python_python 加一个白噪声跟老齐学Python之Python安装
  18. 云画册php,神策指标设计及埋点方案介绍
  19. 基于simulink的PN码伪码匹配的同步仿真,包括解调,伪码匹配,fft等模块
  20. [net][samba]samba用户的查看与删除

热门文章

  1. 软件开发安全左移最佳工具-iast
  2. 软件测试用例设计(三)——场景法
  3. 软件测试——测试用例之场景法
  4. 学习ajxa 必备插件
  5. 公众号数据分析总结怎么做?教你玩转公众号后台数据
  6. 三星识别文字_免费文字识别
  7. python 问卷调查系统_GitHub - JukieChen/surveySystem-1: 问卷调查系统
  8. vscode安装旧版本插件_vscode 常用插件安装
  9. tftp命令怎么传输文件,5步掌握tftp命令的使用方法
  10. 使用docker搭建steam 饥荒服务器