Windows msysgit git克隆忽略ssh配置

Windows msysgit git克隆忽略ssh配置,windows,git,ssh,msysgit,openssh,Windows,Git,Ssh,Msysgit,Openssh,我已经安装了msysgit,git使用了正确的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

我已经安装了msysgit,git使用了正确的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克隆时git@bitbucket.org:User/reponame.git
ssh调试消息显示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克隆git@bitbucket.org:User/reponame.git
将查找
~/.ssh/id\u rsa
id\u rsa.pub
,而不是
/d/ssh/bitbucket.ppk

应该采取的措施(因为ssh bitbucket.com确实有效)是:

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


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

原因是我自己的疏忽。Bitbucket使用Bitbucket.org进行回购。好吧,在它使用bitbucket.com之前。

我同意。我在答复中补充了这一点,以使其完整。
git clone bitbucket.com:User/reponame.git