ssh:无法解析主机名 git:名称或服务未知 致命:无法从远程存储库读取 [英] ssh: Could not resolve hostname git: Name or service not known fatal: Could not read from remote repository
本文介绍了ssh:无法解析主机名 git:名称或服务未知 致命:无法从远程存储库读取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的仓库从 HTTPS 切换到 SSH 之后,我在推送到源主机时收到此错误:
After I switched from HTTPS to SSH for my repo then I received this error when pushing to origin master:
ssh: Could not resolve hostname git: Name or service not known
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
我还在 gitlab 中添加了我的 ssh.我该怎么办?
I also add my ssh in the gitlab. What should I do?
推荐答案
我遇到了同样的错误.
更改 .gitconfig
或 .config/git/config
中的 [remote "origin"]
url
值代码>文件
Change the [remote "origin"]
url
value in .gitconfig
or .config/git/config
file
以前:
https://git@github.com:userName/repo.git
或
ssh://git@github.com:userName/repo.git
新功能:
git@github.com:userName/repo.git
这篇关于ssh:无法解析主机名 git:名称或服务未知 致命:无法从远程存储库读取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文