Little Git Tricks: Fix Unexpected Disconnect on Sideband Packet
I run into a strange error while trying to clone a Git repository from Azure DevOps on the command line:
Read from remote host vs-ssh.visualstudio.com: Connection reset by peer
client_loop: send disconnect: Connection reset by peer
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output
The default output of Git did not give me any clues on what went wrong, so I tried to increase the log output with these three environment variables:
That increased the output, but did not help in finding the solution. Googling the problem offered many ideas, but waiting 15 minutes between each attempt made this a frustrating experience. Especially when the problem persisted no matter what I tried.
It was time to try something new and see if there was a newer version of Git. On my machine I had version 2.47:
The current version of Git was 2.49, that I could instal with winget command:
A quick check showed that the new version was up and running:
Even better, with this version the strange problem was gone, and I finally could clone my repository. Should you run into this problem, do not waste time and update Git right away!