git clone 结果:“致命:远程端意外挂断”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6429787/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
git clone results in: "fatal: The remote end hung up unexpectedly"
提问by shajin
I want to clone a new project with a command like
我想用类似的命令克隆一个新项目
git clone git@some_link.com:some_word/project_name.git
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
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?
当我尝试从 github 克隆时遇到此错误,我将我的 ssh 密钥添加到 github.com。我怎么会在这里?
回答by db42
Try these:
试试这些:
git clone user@host:/path/to/repository/project_name.git
git clone ssh://user@host/path/to/repository/project_name.git
回答by jdd
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 be ssh-copy-id
.
如果它是您拥有写入权限的存储库,请用于ssh-copy-id
复制您的身份。谷歌可以提供一个简单的脚本,为 OSX 做同样的事情(ssh-copy-id
只是一个简单的脚本 afaik)。在 Windows 上,我不知道,除非你使用 Cygwin,在这种情况下它应该只是ssh-copy-id
.
If it's not a repo you have write access to, make the url http://somewhere.tld/path/to/repo.git
or https://somewhere.tld/path/to/repo.git
如果它不是您具有写访问权限的存储库,请输入 urlhttp://somewhere.tld/path/to/repo.git
或https://somewhere.tld/path/to/repo.git
If it's a repo you shouldhave 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?
从错误来看,它可能拼写错误。如果上述内容不能解决您的问题,您能否发布您正在使用和查看的确切命令和输出?