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

前端之家收集整理的这篇文章主要介绍了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

原文链接:https://www.f2er.com/ruby/273577.html

猜你在找的Ruby相关文章