无法使用 SSH 密钥从 git bash 克隆任何 git 存储库

Cannot clone any git repository from git bash with SSH key

我想克隆存储库 git@git01-ifm-min.ad.fh-bielefeld.de:pm_group/PM-Studis.git,这不在 Github 上,所以我不能为此使用 Github。我以为您只需在 Git Bash 中输入 git clone [remote repository name],但是当我这样做时,我收到以下消息:

$ git clone git@git01-ifm-min.ad.fh-bielefeld.de:pm_group/PM-Studis.git
Cloning into 'PM-Studis'...
ssh: Could not resolve hostname git01-ifm-min.ad.fh-bielefeld.de: 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.

所以这可能与我试图从中获取存储库的服务器有关(不是真的,我相当确定它必须有效),所以我再次尝试从 Github(使用 SSH 选项)查看每个存储库是否发生相同情况。在那里我得到了一些不同的信息:

$ git clone git@github.com:google/agera.git
Cloning into 'agera'...
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

但是当我使用 HTTPS URL 克隆它时,一切正常。

我试图找出这个 SSH 是关于什么的,并在 Github 上找到了 this guide。在那里我遵循了 "Generating a new SSH key and adding it to the ssh-agent" 步骤(在此之前 .ssh 文件夹已经存在,其中只有一个已知主机文件)。在那之后,当我输入 "ssh-add -l" 它会显示创建的密钥,所以我认为这意味着密钥现在是 "in use".

但是当我再次键入 "git clone [url]" 时,我仍然收到相同的错误消息,无论是在我尝试克隆 Github 存储库时还是我要克隆的存储库时。所以我不知道接下来要尝试什么。我还需要用钥匙做些什么吗?如果这个问题的解决方案并不简单,也许其他人可以获取存储库的内容并向我发送下载 link(假设它是存储库的有效 link,但它无效就没有意义了)。

(我用的是Windows7)

由于您提到您无权访问远程服务器,因此您必须使用 git

以外的其他传输协议

了解协议 here 您是否感兴趣。