Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why git under cygwin asks for password?

Tags:

git

ssh

cygwin

I correctly pointed to key file in 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.

and using cygwin's 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

But when I try to push it displays a password prompt:

$ 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.

Why is that happening?

like image 367
Poma Avatar asked Apr 25 '15 13:04

Poma


1 Answers

As a workaround, try doing the same setup (~/.ssh/config) on Windows only (no cygwin, with the latest git-for-windows (unzip anywhere you want PortableGit-2.4.4.2-3rd-release-candidate-64-bit.7z.exe, and you got git 2.4.4: see more here)

By using a git-cmd.exe (or git-bash.exe), you will get an environment where HOME has been set to your %USERPROFILE%.
In it, put your .ssh/config file, and try again pushing from your repo.

like image 198
VonC Avatar answered Sep 20 '22 11:09

VonC