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

Pom*_*oma 7 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.
Run Code Online (Sandbox Code Playgroud)

并使用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
Run Code Online (Sandbox Code Playgroud)

但是当我尝试推送它时会显示密码提示:

$ 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.
Run Code Online (Sandbox Code Playgroud)

为什么会这样?

Von*_*onC 1

作为解决方法,尝试仅在 Windows 上执行相同的设置 (~/.ssh/config)(没有 cygwin,使用最新的 git-for-windows(解压到您想要的任何位置PortableGit-2.4.4.2-3rd-release-candidate-64-bit.7z.exe,然后获得 git 2.4.4:在此处查看更多信息

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