【发布时间】:2019-04-07 08:31:48
【问题描述】:
在我的仓库从 HTTPS 切换到 SSH 后,我在推送到源主机时收到此错误:
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。我该怎么办?
【问题讨论】:
-
你是如何切换的?你可以粘贴你使用的命令吗?这可能是某个地方的错字
-
我是这样做的:git remote add origin mySSH_url
-
您是使用默认名称还是自定义生成 ssh 密钥?如果是自定义的,您是否更改了 URL 格式?
-
你能发布 mySSH_url,除非它是秘密的?我仍然认为您可能有错字,可能是格式错误或其他什么
-
不! mySSH_url 是正确的。我仔细检查了一下。