Git问题记录—无法push代码

image-20201219153551001

最近在使用 Git 过程中经常遇到无法上传的问题,即以下命令无效,且出现 图1 所示的错误,显示无法读取远程仓库。在尝试多种解决方案之后,觅得一正解如下:

git push -u origin master

img

图1

该类情况很大可能是说明 Git 软件无法通过 ssh 连接到远程仓库,这时最简单的处理方法就是切换与远程仓库的连接方式(图2),改为 HTTPS 连接,具体操作为

image-20210609223556762

图2

git remote rm origin //删除远程地址
git remote add origin https:.....//增加新的https远程地址

image-20210609154554001

图3

参考资料:

git - GitHub Error - “ssh: connect to host github.com port 22: Operation timed out fatal: Could not read from remote repository.” - Stack Overflow

如何解决git – Connection reset by server_ip] port 22 (juejin.cn)

Git笔记-Connection reset by 13.229.188.59 port 22 fatal: Could not read from remote repository._IT1995的博客-CSDN博客

Connection reset by server_ip\port 22 (hexo d 部署博客出错) - 梦飞扬~ - 博客园 (cnblogs.com)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

硬核小青年

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值