我正在尝试使用SSH克隆git存储库。因此,我在本地机器上创建了一个ssh密钥对,并将公钥添加到我的git存储库(即Bitbucket服务器)。
然后,如我在这里所看到的那样,我尝试以以下方式进行克隆:
git clone ssh://my_username@my-repository.com:7999/my_project.git
git clone ssh://git@my-repository.com:7999/my_project.git
然而,这些选项并没有起作用:
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
我唯一取得进展的方法是尝试这个:
git clone my_username@my-repository.com:7999/my_project.git
这个程序让我输入密码3次,但是最后失败了。我怀疑它并没有使用SSH,因为SSH不应该要求输入密码。
Password:
Password:
Password:
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,keyboard-interactive).
fatal: Could not read from remote repository.
那么我该如何使用SSH克隆git仓库呢?
编辑:
我在Windows系统上,使用的是Git Bash。
ssh-add -l
返回结果
The agent has no identities.