msysgit git克隆忽略sshconfiguration

我已经安装了msysgitgit使用正确的ssh.exe。 所有命令都在msysgit shell(程序文件x86 sh.exe)中执行。 然后我把我的〜/ .ssh / config文件设置为这个

LogLevel DEBUG1 Host bitbucket.com HostName bitbucket.com PreferredAuthentications publickey IdentityFile /d/ssh/bitbucket.ppk IdentitiesOnly yes 

然后ssh bitbucket.com运作良好:

 $ ssh bitbucket.com debug1: Connecting to bitbucket.com [131.103.20.173] port 22. debug1: Connection established. debug1: identity file /d/ssh/bitbucket.ppk type -1 debug1: identity file /d/ssh/bitbucket.ppk-cert type -1 

但是当我尝试git clone git@bitbucket.org:User/reponame.git sshdebugging消息告诉我,SSH甚至不尝试挑选bitbucket ppk,而是尝试使用默认键:

 $ git clone git@bitbucket.org:user/reponame.git Cloning into 'reponame'... debug1: Connecting to bitbucket.org [131.103.20.168] port 22. debug1: Connection established. debug1: identity file /c/Users/bob/.ssh/id_rsa type -1 debug1: identity file /c/Users/bob/.ssh/id_rsa-cert type -1 debug1: identity file /c/Users/bob/.ssh/id_dsa type -1 debug1: identity file /c/Users/bob/.ssh/id_dsa-cert type -1 debug1: identity file /c/Users/bob/.ssh/id_ecdsa type -1 debug1: identity file /c/Users/bob/.ssh/id_ecdsa-cert type -1 debug1: identity file /c/Users/bob/.ssh/id_ed25519 type -1 debug1: identity file /c/Users/bob/.ssh/id_ed25519-cert type -1 

我没有想法。

 $ where git C:\Program Files (x86)\Git\bin\git.exe C:\Program Files (x86)\Git\cmd\git.exe 

git clone git@bitbucket.org:User/reponame.git会查找~/.ssh/id_rsaid_rsa.pub ,而不是/d/ssh/bitbucket.ppk

什么应该工作(因为ssh bitbucket.com确实工作)是:

 git clone bitbucket.com:User/reponame.git 

这实际上会使用~/.ssh/config文件中定义的参数。

bitbucket.com是配置文件中的条目(它可以被命名为任何东西),但是HostName必须确实是bitbucket.org ,它是存储Git仓库的域。

原因是我自己不注意。 Bitbucket使用bitbucket.org进行回购。 Afaik,它之前使用bitbucket.com。