在Git GUI中通过SSH从BitBucket克隆repo

在Git GUI中通过SSH从BitBucket克隆repo,git,ssh,bitbucket,Git,Ssh,Bitbucket,我在BitBucket上有一个存储库,我正在尝试使用Git GUI通过SSH连接到它,并将存储库克隆到我的本地文件夹。我已经向BitBucket帐户(在设置->SSH密钥中)添加了一个公钥(用Git生成) 我从BitBucket复制clone命令(存储库源页面中的“clone this repository”选项),并将其粘贴到Git GUI。克隆命令: git clone git@bitbucket.org:mycode/myserver.git 然后我按下“克隆”按钮,出现以下错误: gi

我在BitBucket上有一个存储库,我正在尝试使用Git GUI通过SSH连接到它,并将存储库克隆到我的本地文件夹。我已经向BitBucket帐户(在设置->SSH密钥中)添加了一个公钥(用Git生成)

我从BitBucket复制clone命令(存储库源页面中的“clone this repository”选项),并将其粘贴到Git GUI。克隆命令:

git clone git@bitbucket.org:mycode/myserver.git
然后我按下“克隆”按钮,出现以下错误:

git clone git@bitbucket.org: Permission denied (publickey).
fatal: Could not read from remote repository.

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

这里我还忘了什么,它不起作用了?

好的,所以我在Git的bash中配置了我的用户帐户,然后键入clone命令,它就起作用了

配置用户:

$ git config --global user.name myusername
$ git config --global user.email myemail@email.com
然后是回购克隆

$ git clone git@bitbucket.org:mycode/myserver.git LocalRelativeFolderName

你添加私钥了吗?您可以使用git clone-v获得更多信息git@bitbucket.org:mycode/myserver.git。也许这对我在哪里添加私钥有帮助?我在Git的安装文件夹中使用了start-ssh-agent.cmd命令。它在我的本地文件夹C:\Users\username\.ssh\中生成了文件:id\u rsa和id\u rsa.pub。我认为id_rsa是私钥,Git应该知道在那个位置找到它。这个命令只生成了两个密钥,但是您的ssh代理不知道它们的存在。您可以遵循以下思路: