为什么git下cygwin要求输入密码?

时间:2015-04-25 13:25:21

标签: git ssh cygwin

我在ssh config中正确指向了密钥文件:

$ cat ~/.ssh/config
Host <host>
        IdentityFile /cygdrive/v/poma.pem

$ ssh git@<host>
PTY allocation request failed on channel 0
Welcome to GitLab, Roman!
Connection to <host> closed.

并使用cygwin的git

$ which git
/usr/bin/git

$ git --version
git version 2.1.4

$ /cygdrive/c/Program\ Files\ \(x86\)/Git/bin/git.exe --version
git version 1.9.5.msysgit.1

但是当我尝试按下它时会显示密码提示:

$ git remote -v
origin  git@<host>:poma/deploy.git (fetch)
origin  git@<host>:poma/deploy.git (push)

$ git push -u origin master
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

为什么会这样?

1 个答案:

答案 0 :(得分:0)

作为一种解决方法,尝试在Windows上进行相同的设置(〜/ .ssh / config)(没有cygwin,使用最新的git-for-windows(在任何你想要的地方解压缩PortableGit-2.4.4.2-3rd-release-candidate-64-bit.7z.exe),你得到了git 2.4.4:see more here

通过使用git-cmd.exe(或git-bash.exe),您将获得一个将HOME设置为%USERPROFILE%的环境。 在其中,放入.ssh / config文件,然后再次尝试从您的仓库中推送。

相关问题