Skip to content

Error using git in ssh repository in Git Bash #1918

Closed
@Jule-

Description

@Jule-
  • I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options

git version 2.19.1.windows.1
cpu: x86_64
built from commit: 11a3092e18f2201acd53e45aaa006f1601b6c02a
sizeof-long: 4
sizeof-size_t: 8
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver

Microsoft Windows [version 10.0.17134.345]
  • What options did you set as part of the installation? Or did you choose the
    defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt

Editor Option: VisualStudioCodeInsiders
Custom Editor Path:
Path Option: Cmd
SSH Option: OpenSSH
CURL Option: OpenSSL
CRLF Option: LFOnly
Bash Terminal Option: MinTTY
Performance Tweaks FSCache: Enabled
Use Credential Manager: Enabled
Enable Symlinks: Enabled
Enable Builtin Rebase: Disabled
Enable Builtin Stash: Disabled
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

I am using on the same machine WSL, Cmder, Git Bash, SourceTree, Putty Pageant. I did not notice what update start messing up my dev environment. Windows, SourceTree, Git,... But it was working in the near past.

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

Git Bash

# May be the clone could trigger the issue
git clone git@github.com:git-for-windows/git.git
cd git
# In my case I have only seen it with basically all remote git commands
git fetch
  • What did you expect to occur after running these commands?

Doing the job.

  • What actually happened instead?

Command failed:

$ git fetch
CreateProcessW failed error:193
ssh_askpass: posix_spawn: Unknown error
...

I have achieved to fix this issue changing script execution policy. Don't know why but now it works even after having my execution policy back to Restricted.

What I've done:

  1. Start PowerShell with administration rights
  2. Get my current script execution policy for later
$currentExecutionPolicy = Get-ExecutionPolicy
  1. Set it to run local scripts not coming from internet
Set-ExecutionPolicy RemoteSigned
  1. Try to fetch an ssh repository
  2. (optional) Then restore my previous script execution policy, and it still works!
Set-ExecutionPolicy $currentExecutionPolicy

Don't know if it can help people with the same issue or even if you can somehow fix this issue by warning users or other...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions