Win32-OpenSSH icon indicating copy to clipboard operation
Win32-OpenSSH copied to clipboard

Cloning a Git repository using ssh.exe hangs

Open splatteredbits opened this issue 7 years ago • 11 comments

When I try to use your version of ssh.exe with Git to clone a repository, it hanges.

Steps to Reproduce

  • Install Git for Windows (I'm on 2.10.1 on Windows 7, bot x64)
  • Open a new PowerShell prompt (so git.exe is in your PATH)
  • Set the GIT_SSH environment variable to point to Win32-OpenSSH's ssh.exe: `Set-Item env:GIT_SSH "C:\Program Files\Open-SSH-Win64\ssh.exe"
  • Clone a Git repository using SSH: git clone ssh://HOSTNAME/REPO REPO.
  • Note that the git.exe command hangs.

splatteredbits avatar Oct 28 '16 21:10 splatteredbits

ssh.exe is deadlocking at file read in 'fileio_ReadFileEx()'. Looking at the fd table, the index is 4, which is STD_INPUT.

image

git clone [email protected]:PowerShell/openssh-portable.git The underlying cmd is ssh.exe [email protected] "git-upload-pack 'PowerShell/openssh-portable.git'"

arif-pragmasys avatar Dec 02 '16 22:12 arif-pragmasys

I'm seeing this as well, in v0.0.19.0

analogrelay avatar Sep 01 '17 22:09 analogrelay

This has been open for nearly a year, is this being considered for a fix? Not having this bug fixed will completely block my usage of the OpenSSH client for Windows.

analogrelay avatar Sep 05 '17 17:09 analogrelay

🎉 thanks for the update @manojampalam !

analogrelay avatar Sep 05 '17 18:09 analogrelay

@anurse, this is due to the same issue as #752. Can you try the workaround in Setting up a Git server on Windows using Git for Windows and Win32_OpenSSH. please let me know if you see any other issue.

Move this issue to Beta until we have a proper fix on server.

bingbing8 avatar Oct 02 '17 19:10 bingbing8

I can try the workaround later if you need verification of it, but I've already switched back to using msys OpenSSH because of the issue and the workaround is pretty invasive, so I'll probably just wait for a proper fix.

analogrelay avatar Oct 02 '17 19:10 analogrelay

Hang on, I'm confused by how the workaround should fix this issue. In my case, I'm cloning from github.com, which is not running Win32_OpenSSH on the server, it is running the upstream Unix version of OpenSSH. The workaround seems to be designed to fix cloning issues with a Win32_OpenSSH server, so it wouldn't apply. Am I misunderstanding it?

analogrelay avatar Oct 02 '17 19:10 analogrelay

Works for me with 0.0.24.0, but very slow 300 Kb/s cloning from GitHub (Git SSH give me 9Mb/s)

KindDragon avatar Dec 12 '17 11:12 KindDragon

This by far is the easier way to get around the double quote issue: powershell New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\Program Files\Git\bin\bash.exe" -PropertyType String -Force This changes the default OpenSSH shell to bash.

naloqab avatar Apr 15 '19 21:04 naloqab

This is still happening today. git clone hangs.

X9VoiD avatar Aug 26 '22 22:08 X9VoiD