Skip to content Skip to sidebar Skip to footer

Github - Unexpected Disconnect While Reading Sideband Packet

I've got quite interesting problem. I tried to send some projects via bash to repo and recently there was a problem with sending it. Enumerating objects: 27, done. Counting objects

Solution 1:

First of all, check your network connection stability.

If there is no problem with network connection try another solution; it may work:

On Linux

Execute the following in the command line before executing the Git command:

export GIT_TRACE_PACKET=1
export GIT_TRACE=1
export GIT_CURL_VERBOSE=1

On Windows

Execute the following in the command line before executing the Git command:

set GIT_TRACE_PACKET=1
set GIT_TRACE=1
set GIT_CURL_VERBOSE=1

In addition:

git config --global core.compression0
git clone --depth1 <repo_URI>
# cd to your newly created directory
git fetch --unshallow 
git pull --all

As kodybrown said :

For PowerShell users:

$env:GIT_TRACE_PACKET=1, $env:GIT_TRACE=1, and$env:GIT_CURL_VERBOSE=1

Solution 2:

It might be your network issue. If the network is too slow, then it might disconnect connection unexpectedly.

If you are having a good internet and still getting this message then it might be an issue with post buffer. You can resolve it by executing the following command in your cmd.

git config--global http.postBuffer 157286400

Solution 3:

I didn't want to believe it but after 3 failed clones, switching from a wifi connection (on Mac) to hardwired connection (on Linux) made it work first time. Not sure why!

https://serverfault.com/questions/1056419/git-wsl2-ssh-unexpected-disconnect-while-reading-sideband-packet/1060187#1060187

Solution 4:

In my case, I had a few files that were over 100MB in size when trying to push my initial commit. Since GitHub apparently doesn't allow this, you get an error "unexpected disconnect while reading sideband packet fatal: the remote end hung up unexpectedly".

Using git rm was not enough, I had to start all over again with git init, git add, git commit and git push to resolve the issue.

Solution 5:

If you are using SSH URLs, you can try the following, it worked for me the two times I had the same issue:

  1. Switch to HTTPS origin URL: git remote set-url origin https://github.com/<your_repo>
  2. Do the push. It should not fail now.
  3. Switch back to SSH: git remote set-url origin git@github.com:<your_repo>

I'm still not sure what is the cause of the issue. This is just a work around.

Post a Comment for "Github - Unexpected Disconnect While Reading Sideband Packet"