git push远程仓库报错fatal: Could not read from remote repository.

昨天修复好wsl与vscode的连接问题后,wsl上ubuntu18.04的本地代码仓库可以正常使用,但当使用git push推送代码到远程仓库时报错,信息如下:

git push
ssh: Could not resolve hostname codeup.aliyun.com: Temporary failure in name resolution
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

检查远程仓库:

git remote -v
origin  git@codeup.aliyun.com:5fbxxx4d95/odoo/abc.git (fetch)
origin  git@codeup.aliyun.com:5fbxxx4d95/odoo/abc.git (push)

在远程仓库服务器上将本机公钥重新配置上去,但仍然报错:

git push
The authenticity of host 'codeup.aliyun.com (18.131.65.50)' can't be established.
RSA key fingerprint is SHA256:yEabcVrc3QAvDvoBrTCF2cdefmQ+AbWi9vSt/fE.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'codeup.aliyun.com,18.131.65.50' (RSA) to the list of known hosts.
git@codeup.aliyun.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

看来远程仓库使用SSH方式一时半会搞不好,但可以使用HTTPS。
在这里插入图片描述
git删除远程仓库旧的连接地址,再添加新的连接地址,推送远程仓库时输入帐密即可顺利提交代码到远程仓库。

git remote rm origin
git remote add origin https://codeup.aliyun.com/5fbxxx4d95/odoo/abc.git
git push --set-upstream origin master
  • 3
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值