我刚拿到我的新笔记本电脑(Windows 7),并想克隆第一个存储库。 我使用SSH连接和私钥。 令我惊讶的是,git bash无法看到我的主目录使用.ssh默认目录:
$ git clone git@bitbucket.org:<blablabla> Cloning into 'XXX'... Could not create directory '/u//.ssh'. The authenticity of host 'bitbucket.org (104.192.143.3)' can't be established. RSA key fingerprint is SHA256:zzXQOXSRBEiUtuE8AikJYKwbHaxvSc0ojez9YXaGp1A. Are you sure you want to continue connecting (yes/no)? yes Failed to add the host to the list of known hosts (/u/.ssh/known_hosts).
而不是标准/C/Users/my_name
我看到/u
在path中 – 从哪里来的? 看起来像Git Bash以外的一切工作正常,我也检查%USERPROFILE%envvariables,它设置正确。
提供更多的细节来澄清一些问题
C:\Workspace
,右键单击并select了Git Bash Here
。 $HOME
目录设置为/u/
– 所以我猜这是问题的根源。 我应该在Git Bash的一些初始脚本中强制更改这个variables吗? C:\Workspace
。 我在Windows中添加了指向我的主目录的HOME
环境变量 – Git Bash现在可以正确解析它。 不过,我不确定是最好的解决方案还是某种解决方法。