Github Connection was aborted && Couldn‘t connect to server

最近使用github × Source Tree开发时遇到了Connection was aborted && Couldn’t connect to server这俩问题,记录一下我解决问题的全流程

获取Github personal token

在设置的这里generate token,权限全部勾上就行,记得找个地儿保存好token不要问我怎么知道的
在这里插入图片描述

在Clone使用Token

原本git clone的指令如下 ( 加粗部分为仓库http链接 ) :
git clone https://github.com/<username>/<repo>.git

现在已经不能直接按上述使用了,需要在https://后加自己的token
git clone https://<your token>@github.com/<username>/<repo>.git

PS.别把<和 > 也写进去了

在Push使用Token

通过git remote查看当前url ( 一般为origin )
使用git remote set-url <url> https://<your token>@github.com/<username>/<repo>.git 设置该url的提交路径是走你的token进仓库的

之后正常的add commit push pull就可以了

问题解决

Connection was aborted && Couldn’t connect to server本质上是两个问题,一是权限不够无法访问,因此可以按上述token的方法解决,二是代理的问题,下面是我解决问题的流程。

Git Bash中

  1. git config --system --unset credential.helper
  2. git config --global --unset http.proxy
  3. git config --global --unset https.proxy

CMD中

  1. ipconfig/flushdns

Git Bash中

  1. 获取 token 并完成git remote set-url <url> https://<your token>@github.com/<username>/<repo>.git 设置

CMD中

  1. ipconfig/flushdns

之后就可以正常push/clone了

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
"Failed to connect to github.com port 443 after ms: Couldn't connect to server"这个错误通常是由于网络连接问题导致的。它表示无法连接到Github服务器的443端口。可能的原因包括网络故障、防火墙阻止了连接、代理配置问题等。为了解决这个问题,你可以尝试以下几个步骤: 1. 检查你的网络连接是否正常。确保你的网络连接稳定,并且没有任何被阻止的网络设置。 2. 检查你的防火墙设置。防火墙可能会阻止对Github服务器的访问。你可以尝试暂时禁用防火墙,然后再次尝试连接。 3. 检查代理配置。如果你使用了代理服务器来连接网络,确保你的代理配置是正确的。你可以尝试更改代理设置或者禁用代理,然后再次尝试连接。 4. 尝试使用其他网络。有时候,网络服务提供商可能会有问题,导致无法连接到某些特定的服务器。你可以尝试连接另一个网络,比如移动数据网络,看看问题是否依然存在。 如果你在尝试了上述步骤之后仍然无法解决问题,那么可能是Github服务器出现了问题。你可以稍后再次尝试连接,或者联系Github支持团队获取更多帮助。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [Failed to connect to github.com port 443 after 21111 ms: Couldn‘t connect to server](https://blog.csdn.net/weixin_49171365/article/details/131795094)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *2* [Failed to connect to github.com port 443 after 21116 ms: Couldn‘t connect to server](https://blog.csdn.net/summer089089/article/details/130984194)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值