加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – 无法推送到github,ssh:无法解析主机名

发布时间:2020-12-16 20:31:28 所属栏目:百科 来源:网络整理
导读:我不能通过这个,多次重建存储库,使ssh密钥结束 --------------demo_app username$git remote add origin git@github.com:username/demo_app.gitfatal: remote origin already exists.$git push -u origin master---ssh: Could not resolve hostname git: nod
我不能通过这个,多次重建存储库,使ssh密钥结束
--------------
demo_app <username>$git remote add origin git@github.com:<username>/demo_app.git

fatal: remote origin already exists.

$git push -u origin master
---
ssh: Could not resolve hostname git: nodename nor servname provided,or not known
---
fatal: Could not read from remote repository.
---
Please make sure you have the correct access rights
---
and the repository exists.
----------
---------

Checked ssh keys

---

$ssh -T git@github.com

Hi <username>! You've successfully authenticated,but GitHub does not provide shell access.

---

仍然收到相同的消息.

解决方法

而不是添加一个新的远程,请尝试使用以下命令更改现有的远程:
git remote set-url origin git@github.com:<username>/demo_app.git

编辑:所以,这里是使它的工作,而不会丢失你的代码的命令.

> rm -rf .git> git initgit remote add origin git@github.com:< username> /demo_app.git> git commit –allow-empty -m’首先提交’> git push origin master

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读