Git early EOF errors

If you're using Git for Windows and you've configured the GIT_SSH environment variable to point at C:\Windows\System32\OpenSSH\ssh.exe, you may see errors like the following:

$ git clone git@github.com:Azure/azure-cli.git
Cloning into 'azure-cli'...
warning: agent returned different signature type ssh-rsa (expected rsa-sha2-512)
remote: Enumerating objects: 113050, done.
[snip]
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

This is a known bug which seems to happen with specific repository states on both the client and server.

Give up and use PuTTY instead

Because Microsoft have done an awful job of maintaining their OpenSSH port I'd suggest using PuTTY as your GIT_SSH client.

Temporary workaround

As a workaround, you'll need to clone over HTTP instead of SSH. Note that doing so on many hosts (including Bitbucket, GitHub and GitLab) will require password authentication. Other services may not provide access to repositories over HTTP.

If you're working with an existing repository, change the remote address to use HTTPS:

git remote set-url origin https://github.com/Azure/azure-cli.git

Perform your operation, then change it back:

git remote set-url origin git@github.com:Azure/azure-cli.git