我正在开始我的项目并使用 github 进行远程回购。
我将操作系统从 Ubuntu 更改为 Xubuntu。
但是我将所有旧文件都复制到了新位置。
我继续使用我需要推动更改的程序。
我生成了新的 SSH 密钥并添加到了 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能解释一下吗?
如何解决这个麻烦?