【发布时间】:2014-05-31 21:46:04
【问题描述】:
我想尝试在我的常规 Windows 提示符中而不是在 Git Bash 中使用 git。仅仅是因为我可以使用 IntelliJ 提供的终端。我认为这是一个 1 分钟的修复,但我猜不是。
当我尝试git pull origin <branch> 时,我收到以下错误消息:
C:\Users\Username\Documents\Bitbucket\java-project>git pull
Could not create directory '/c/Username/.ssh'.
The authenticity of host 'bitbucket.org (131.103.20.167)' can't be established.
RSA key fingerprint is 12:8c:1b:f2:6d:14:6b:5c:3b:ec:aa:46:46:xy:7c:40.
Are you sure you want to continue connecting (yes/no)? yes
Failed to add the host to the list of known hosts (/c/Username/.ssh/known_hosts).
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
我已设置现有 .ssh 文件夹的权限,以便所有用户(管理员和系统)都具有完全访问权限。所以应该没问题。
我还尝试以管理员身份运行提示以查看是否是问题所在,但事实并非如此。
我现在注意到的是它说:Could not create directory '/c/Username/.ssh'.。但是,我的.ssh 目录位于C:\Users\Username\.ssh。那么我可能需要更改我的配置。
Git 版本: 1.9.0.msysgit.0 Windows 版本: Windows 8.1
【问题讨论】:
-
它是否在 git bash 提示符下工作?
-
是的,它在那里工作得很好。我已经用了一两年了。
-
那个路径'/c/Username/.ssh'看起来很有趣,不应该是'/c/Users/Username/.ssh'吗?
-
确实如此。我注意到了同样的事情。我已经创建了一个文件
C:\Users\Username\.ssh\config,其内容为UserKnownHostsFile /c/Users/Username/.ssh/known_hosts。但我认为git对在哪里可以找到我的 .ssh 文件夹感到困惑。 -
也许你在 cmd.exe 中定义了错误值的 HOME 环境变量
标签: windows git command-line