git clone over ssh 错误“致命:远程端意外挂断”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13754578/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 07:52:12  来源:igfitidea点击:

git clone over ssh error 'fatal: The remote end hung up unexpectedly'

gitssh

提问by Eugene Yu

I'm pretty new to using git and have been struggling to get it work for the last 2 days and now I feel so stupid that I still haven't got it working yet.

我对使用 git 还很陌生,过去 2 天一直在努力让它工作,现在我觉得太愚蠢了,我还没有让它工作。

I've seen many posts talking about the similar error but none of the answers solved my problem.

我看到很多帖子都在谈论类似的错误,但没有一个答案解决了我的问题。

my situation here is

我的情况是

  1. project git called itko-ext.gitis stored in a server and I have an access via ssh

  2. So I create a repositary directory on my local storage and used git init

  3. To copy the itko-ext.gitinto my repositary, I used git clone ssh://username@host/home/shared/g_quoll/repos/itko-ext.git

    • and this gives me an error fatal: The remote end hung up unexpectedly.
    • I have access to the resource.
  1. 被调用的项目 gititko-ext.git存储在服务器中,我可以通过 ssh 访问

  2. 所以我在本地存储上创建了一个存储库目录并使用 git init

  3. 要将其复制itko-ext.git到我的存储库中,我使用了git clone ssh://username@host/home/shared/g_quoll/repos/itko-ext.git

    • 这给了我一个错误fatal: The remote end hung up unexpectedly
    • 我可以访问该资源。

I will appreciate any solution.

我将不胜感激任何解决方案。

Regards

问候

采纳答案by pcm

Can you verify that that A) you indeed can ssh into the server, and B) that the repository is exactly at the path specified?

您能否验证 A) 您确实可以通过 ssh 连接到服务器,以及 B) 存储库是否正好位于指定的路径中?

You can do ssh username@host ls /home/shared/g_quoll/repos/ and see if there is a itko-ext.git directory there.

您可以执行 ssh username@host ls /home/shared/g_quoll/repos/ 并查看那里是否有 itko-ext.git 目录。

回答by Michael

Try:

尝试:

git clone username@host:/home/shared/g_quoll/repos/itko-ext