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

我不能通过这个,多次重建存储库,使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

相关文章

validates:conclusion,:presence=>true,:inclusion=>{...
一、redis集群搭建redis3.0以前,提供了Sentinel工具来监控各...
分享一下我老师大神的人工智能教程。零基础!通俗易懂!风趣...
上一篇博文 ruby传参之引用类型 里边定义了一个方法名 mo...
一编程与编程语言 什么是编程语言? 能够被计算机所识别的表...
Ruby类和对象Ruby是一种完美的面向对象编程语言。面向对象编...