gpt4 book ai didi

ruby-on-rails - 无法推送到 github,ssh : Could not resolve hostname

转载 作者:IT王子 更新时间:2023-10-29 00:36:03 27 4
gpt4 key购买 nike

我无法通过这个,已经多次重新制作存储库,制作了 ssh key

--------------
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.

---

仍然收到相同的消息。

最佳答案

不要添加新的 Remote ,而是尝试使用以下命令更改现有的 Remote :

git remote set-url origin git@github.com:<username>/demo_app.git

编辑:所以,这里有一些命令可以让它在不丢失代码的情况下工作。

  1. rm -rf .git
  2. git init .
  3. git remote add origin git@github.com:<username>/demo_app.git
  4. git commit --allow-empty -m 'First commit'
  5. git push origin master

关于ruby-on-rails - 无法推送到 github,ssh : Could not resolve hostname,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16548173/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com