3

所以我只花了大约 4 小时试图在 Windows 上的 SSH URL 下运行一个 repo,我快到了,但我遇到了这个奇怪的问题。

我可以使用

git push origin master
git fetch origin master
ssh git@github. #tells me authentication is successful but shell access is not allowed

和所有本地命令。但是,当我尝试执行 git pull 时,我得到:

-bash-4.1$ git pull
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
-bash-4.1$

我确实有id_rsa,并且公钥已添加到我的 GitHub 帐户中id_rsa.pub%HOME%/.ssh我的 git URL 也是正确的。

编辑

-bash-4.1$ git --version
git version 1.8.5.2.msysgit.0
4

3 回答 3

2

这是我解决问题的方法:

在下创建一个名为configfile的文件cygwin64/home/<username>/.ssh

IdentityFile <path to your private key>向它添加行

于 2014-02-04T07:32:03.660 回答
2

该问题可能会持续存在,因为git并且cygwin具有不同的.ssh目录。

当你这样做时,它使用文件夹中ssh git@github指定的那个,但是当你做 a 时,它使用文件夹中的存在。.sshcygwingit pullid_rsagit bash's .ssh

查看我的问题 => ssh clone not cloning repo in git

于 2014-02-04T06:22:59.480 回答
1

您可能是从不同的位置拉车吗?

尝试:

git pull origin master
于 2014-02-04T06:40:35.540 回答