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

Ruby on rails 无法推送到github,ssh:无法解析主机名,ruby-on-rails,git,github,ssh,push,Ruby On Rails,Git,Github,Ssh,Push,我无法通过这个,我多次重新制作了存储库,并使用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: node

我无法通过这个,我多次重新制作了存储库,并使用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远程添加源git@github.com:/demo\u app.git
致命:远程源已存在。
$git推送-u原始主机
---
ssh:无法解析主机名git:nodename或提供的servname,或未知
---
致命:无法从远程存储库读取。
---
请确保您拥有正确的访问权限
---
并且存储库存在。
----------
---------
检查ssh密钥
---
$ssh-Tgit@github.com
你好您已成功通过身份验证,但GitHub不提供shell访问。
---

仍在接收相同的消息。

请尝试使用以下命令更改现有的远程设备,而不是添加新的远程设备:

git remote set-url origin git@github.com:<username>/demo_app.git
git远程设置url源git@github.com:/demo\u app.git
编辑:下面是一些命令,可以让它在不丢失代码的情况下工作

  • rm-rf.git
  • git init.
  • git远程添加源git@github.com:/demo_app.git
  • git提交--允许空-m“首次提交”
  • git推送原始主机
  • 回答新错误:“错误:src refspec master不匹配任何。错误:无法将某些ref推送到”git@github.com:/demo\u app0.git'

    我发现这篇文章非常有用:

    基本上,请尝试添加文件并再次提交

    
    git提交-m“初始提交”
    git推送源主机
    

    这对我很有用!

    如果你来这里是因为你是代理 试试看:

    ssh -T -p 443 git@ssh.github.com
    
    如果可以,那么您可以将设置添加到
    ~/.ssh/config
    以始终通过
    443
    进行连接:

    Host github.com
      Hostname ssh.github.com
      Port 443 
    
    更多信息请点击此处:

    之前尝试过,结果发现我没有执行$git add。之前,我尝试创建我之前执行的操作以获取错误消息,但得到了一个“diff error”错误:src refspec master与任何错误都不匹配。错误:无法将某些引用推送到'git@github.com:/demo\u app0.git'