一系列问题:fatal: unable to access XXX : Failed to connect to github.com port 443: Timed out

在你项目中创建分支后,你在分支上push代码到远程仓库时你可能会遇到如下的问题:

E:\Javaexample\Zorio>git push
fatal: The current branch dev2 has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin dev2

dev2分支没有和远程仓库关联
此时你输入git push --set-upstream origin dev2 关联时,会报以下错误(以demo项目为例):

E:\Javaexample\Zorio>git push --set-upstream origin dev2
fatal: unable to access 'https://github.com/ZorioneShi/Zorio.git/': Failed to connect to github.com port 443: Timed out

此时是由于你本地代理服务器没有修改,以win10为例,打开网络共享中心,左下角的Internet选项,打开连接选项局域网设置,勾掉代理服务器,选择自动检测设置,保存退出再回到代码。
在这里插入图片描述
输入git push --set-upstream origin dev2命令绑定远程分支,最好本地和远程分支名一样,不易忘记,此时如下代码,则关联远程分支成功

E:\Javaexample\Zorio>git push --set-upstream origin dev2
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), 358 bytes | 358.00 KiB/s, done.
Total 4 (delta 3), reused 0 (delta 0)
remote: Resolving deltas: 100% (3/3), completed with 3 local objects.
remote:
remote: GitHub found 5 vulnerabilities on ZorioneShi/Zorio's default branch (5 low). To find out more, visit:
remote:      https://github.com/ZorioneShi/Zorio/security/dependabot
remote:
To https://github.com/ZorioneShi/Zorio.git
   7676aaf..42eea7e  dev2 -> dev2
Branch 'dev2' set up to track remote branch 'dev2' from 'origin'.

此时若你要提交修改的代码,如若安全http.sslVerify安全设置没有修改,会出以下错误:

E:\Javaexample\Zorio>git push
fatal: unable to access 'https://github.com/ZorioneShi/Zorio.git/': OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054

此时需要你设置一下参数:

E:\Javaexample\Zorio>git config http.sslVerify "false"

然后再执行push命令则可提交到远程分支

E:\Javaexample\Zorio>git push
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), 349 bytes | 349.00 KiB/s, done.
Total 4 (delta 3), reused 0 (delta 0)
remote: Resolving deltas: 100% (3/3), completed with 3 local objects.
remote:
remote: GitHub found 5 vulnerabilities on ZorioneShi/Zorio's default branch (5 low). To find out more, visit:
remote:      https://github.com/ZorioneShi/Zorio/security/dependabot
remote:
To https://github.com/ZorioneShi/Zorio.git
   42eea7e..80335a9  dev2 -> dev2
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值