gpt4 book ai didi

git - 替换到另一台 PC 后无法推送到 github repo

转载 作者:行者123 更新时间:2023-12-02 14:15:04 25 4
gpt4 key购买 nike

我正在开始我的项目并使用 github 进行远程 repo 。

我将操作系统从 Ubuntu 更改为 Xubuntu。

但是我将所有旧文件都复制到了新位置。

我继续使用我需要 push 更改的程序。

我生成了新的 SSH key 并添加到了 github。

我试图推送更改,但它打印出奇怪的信息:

nazar@nazar-desctop:~/Documents/workspace/NewYearGift$ git status
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
nothing to commit (working directory clean)
nazar@nazar-desctop:~/Documents/workspace/NewYearGift$ sudo git push -u origin master
[sudo] password for nazar:
ssh: Could not resolve hostname github.com: Name or service not known
fatal: The remote end hung up unexpectedly

更新:

我再次重新创建了这个项目,现在它询问我的密码:
nazar@nazar-desctop:~/Documents/workspace/NewYearGift$ git commit -m "correct smole issue"
[master e2cbdec] correct smole issue
1 file changed, 29 insertions(+), 29 deletions(-)
rewrite README.md (89%)
nazar@nazar-desctop:~/Documents/workspace/NewYearGift$ git push
Warning: Permanently added the RSA host key for IP address '192.30.252.128' to the list of known hosts.
Enter passphrase for key '/home/nazar/.ssh/id_rsa':
Counting objects: 5, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 843 bytes, done.
Total 3 (delta 1), reused 0 (delta 0)
To git@github.com:nazar-art/NewYearGift.git
3fb0853..e2cbdec master -> master

现在它有效,但为什么这么严格?

smb能解释一下吗?

如何解决这个麻烦?

最佳答案

Could not resolve hostname github.com: Name or service not known



您需要修复系统的解析器。由于某种原因,它无法解析 github.com 的 IP 地址

关于git - 替换到另一台 PC 后无法推送到 github repo,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20720564/

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