git clone 结果:“致命:远程端意外挂起”
我想使用像
git clone git@some_link.com:some_word/project_name.git
这样的命令克隆一个新项目,但它一直给我错误
ssh: 无法解析主机名 some_link.com :some_word: 名称或服务未知
当我尝试从 github 克隆时遇到此错误,我将 ssh 密钥添加到 github.com。我在这里该怎么做?
I want to clone a new project with a command like
git clone git@some_link.com:some_word/project_name.git
But it keeps giving me the error
ssh: Could not resolve hostname some_link.com:some_word: Name or service not known
when I got this error trying to clone from github, I added my ssh key to github.com. How would I do that here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
试试这些:
Try these:
如果您有写入权限的存储库,请使用 ssh-copy-id 复制您的身份。 Google 可以提供一个简单的脚本,为 OSX 执行相同的操作(据我所知,
ssh-copy-id
只是一个简单的脚本)。在 Windows 上,我不知道,除非您使用 Cygwin,在这种情况下它应该只是 ssh-copy-id。如果它不是您具有写入权限的存储库,请将 URL 设置为
http://somewhere.tld/path/to/repo.git
或https://somewhere.tld/path/ to/repo.git
如果它是您应该有权访问但没有访问的存储库(比如在共享主机或其他东西上),您可能只需将其添加到控制面板或联系支持人员。
从错误来看,可能是拼写错误。如果上述方法不能解决您的问题,您可以发布您正在使用和看到的确切命令和输出吗?
If it's a repo you have write access to, use
ssh-copy-id
to copy your identity. Google can provide a simple script that does the same thing for OSX (ssh-copy-id
is just a simple script afaik). On windows, I have no clue, unless you're using Cygwin, in which case it should just bessh-copy-id
.If it's not a repo you have write access to, make the url
http://somewhere.tld/path/to/repo.git
orhttps://somewhere.tld/path/to/repo.git
If it's a repo you should have access to, but don't (like say on a shared host or something), you might just need to add it in a control panel or contact support.
From the error, it may be misspelled. If the above doesn't fix your issue, could you post the exact command and output you're using and seeing?