8

I am using a setup on Windows 10 x64 where I install and manage git via scoop, rather downloading and executing the installer myself. Via the PowerShell, I ran

scoop install git
scoop install openssh
[environment]::setenvironmentvariable('GIT_SSH', (resolve-path (scoop which ssh)), 'USER')

However, now when I try to run commands in the Git Bash like

git clone git@example.org:vendor/repository.git

or a simple

git push/pull

I only get

CreateProcessW failed error:193
ssh_askpass: posix_spawn: Unknown error

instead of the Git Bash asking me for my SSH key's passphrase.

I am using the same setup (git installed via scoop) on many other Windows 10 x64 and no problems occur there. So I am not sure what is going wrong on this one. I previously had git installed without scoop on the same machine and the Git Bash was working fine. I uninstalled git completely (and also restarted the machine, just to be sure) before re-installing it via scoop instead.

The SSH_ASKPASS environment variable contains the following, in case this is relevant:

$ echo ${SSH_ASKPASS}
/mingw64/libexec/git-core/git-gui--askpass

Not sure what that folder refers to (something internal to the Git Bash presumably?), since it obviously does not exist like that on my machine.

Update

When using git-with-openssh instead of just git and openssh separately it works. However, I don't use that on my other machines, so I'd still like to know why it's not working here.

fritzmg
  • 1,929
  • 2
  • 16
  • 43
  • I have the same issue – SovietFrontier Apr 23 '19 at 12:40
  • @SovietFrontier apparently it is recommended to always use `git-with-oppenssh` due to various issues, instead of using `git` and `openssh` separately. – fritzmg Apr 23 '19 at 17:08
  • is there some instructions on how to set all that up? – SovietFrontier Apr 23 '19 at 20:55
  • Just do `scoop uninstall git`, `scoop uninstall openssh`, `scoop install git-with-openssh` and run the commands that are displayed in the console output afterwards. – fritzmg Apr 24 '19 at 06:47
  • In my machine it's still broken, even after I replaced `git` with `git-with-openssh`. – rsenna Jul 10 '20 at 10:23
  • 1
    I came to this page with the same error but *not related to scoop*. In my case, it was a conflict between OpenSSH from Git Bash and Windows 10. The solution was a mix between the solution proposed by @rsenna and [this one](https://stackoverflow.com/a/18915067/2626480) – Willian Jan 23 '21 at 20:11

1 Answers1

2

I'm pretty sure my answer does not address the OP's original case. But as of 2020, there seems to be a similar issue with a different way of solving it, and that's how I did in my case.

Part of the problem is, now Windows 10 has its own version of OpenSSH available, and at least in the case of my work's machine it seems that option is enabled by default.

This bundled OpenSSH is not compatible with Git bash though, so if you wants to use it, you must force git use scoop's provided OpenSSH (either from openssh or git-with-openssh packages). That means overwriting GIT_SSH environment variable, e.g. by adding a line similar to this to your .bashrc:

export GIT_SSH='C:\Users\rogs\scoop\apps\git-with-openssh\current\usr\bin\ssh.exe'

Hope it helps.

rsenna
  • 10,960
  • 1
  • 50
  • 60
  • Well, after installing `git` and `openssh` via _Scoop_, that what you are supposed to do anyway. But in my case, when using `git` and `openssh` separately, it still did not work. – fritzmg Jul 10 '20 at 10:48
  • 1
    But that's the point, I had to do this even after installing `git-with-openssh`. – rsenna Jul 10 '20 at 11:49