0

I've encountered this horrible error message when trying to push sometimes.

> git push
Enumerating objects: 14, done.
Counting objects: 100% (14/14), done.
Delta compression using up to 12 threads
Compressing objects: 100% (7/7), done.
Writing objects: 100% (8/8), 215.75 KiB | 11.35 MiB/s, done.
Total 8 (delta 2), reused 5 (delta 0), pack-reused 0
send-pack: unexpected disconnect while reading sideband packet
Connection to github.com closed by remote host.
fatal: the remote end hung up unexpectedly

I had 5 or 10 files in my latest commit that I wanted to push, and I got this error. Through a lot of trial and error, I managed to push everything in separate commits, except for a single bootstrap css file. The file is only 216KB, so I doubt it's a file size issue. I also doubt it's a network issue because I have had no other internet connection problems in weeks, and have even been on zoom calls sharing my screen while this was happening.

Here's what my terminal looks like when I try to commit and push the file

❯ git status
On branch main
Your branch is up to date with 'origin/main'.

Untracked files:
  (use "git add <file>..." to include in what will be committed)
    java/servers/coins-website/coins-react/src/bootstrap-yeti.css

nothing added to commit but untracked files present (use "git add" to track)
❯ git add .
❯ git commit -m "add bootstrap-yeti.css"
[main b618bc6] add bootstrap-yeti.css
 1 file changed, 11245 insertions(+)
 create mode 100644 java/servers/coins-website/coins-react/src/bootstrap-yeti.css
❯ git push
Enumerating objects: 14, done.
Counting objects: 100% (14/14), done.
Delta compression using up to 12 threads
Compressing objects: 100% (7/7), done.
Writing objects: 100% (8/8), 215.76 KiB | 11.36 MiB/s, done.
Total 8 (delta 2), reused 5 (delta 0), pack-reused 0
send-pack: unexpected disconnect while reading sideband packet
client_loop: send disconnect: Broken pipe
fatal: the remote end hung up unexpectedly

The only thing that seems to work is cloning the repo, moving the file into the new local repo, committing, and pushing. But with that, I have to abandon my branches and stashes in the old repo. I've also had this same issue at work with a much much larger repository, so recloning and breaking up my commits every few days is making me lose my mind.

How can I fix this? Can I reset the .git folder without deleting my branches and stashes?

Alex
  • 79
  • 6
  • This answer explains it: https://stackoverflow.com/questions/66366582/github-unexpected-disconnect-while-reading-sideband-packet – uncletall Jun 24 '21 at 01:52
  • 1
    Does this answer your question? [Github - unexpected disconnect while reading sideband packet](https://stackoverflow.com/questions/66366582/github-unexpected-disconnect-while-reading-sideband-packet) – uncletall Jun 24 '21 at 01:52
  • I have seen that question but none of the answers are helping me. The most common answer I've seen is to increase the http postBuffer, but it hasn't worked for me. And like I said, recloning the repo works, but I want to avoid that because the repository I'm working with is very large. – Alex Jun 24 '21 at 01:59
  • Possible duplicate of https://stackoverflow.com/questions/66366582/github-unexpected-disconnect-while-reading-sideband-packet – tripleee Jun 24 '21 at 04:23
  • Do you see an SSH `git@github.com` or an HTTPS URL when you type `git remote -v` in your repo? And can you test, just after seeing this error, a push with the opposite protocol, for testing? (SSH if you are using HTTPS, or vice-versa) – VonC Jun 24 '21 at 06:45
  • Looks like a broken repository to me. I would do (for getting more insight): First, backup `bootstrap-yeti.css` somewhere. then copy it to a new name and into a different directory in your repo and do a _push_. If it works, we know that it is not the content of the file. The rename it at that new location back to _bootstrap-yeti.css_ and push again. If it works, we know it's not the file name. Then place it into its original location (`coins-react/src`), but under a different name (perhaps `dummy.css`) and push. If this works too, do a `git mv dummy.css bootstrap-yeti.css` and try to push. – user1934428 Jun 24 '21 at 07:14
  • Re-cloning should (a) be unnecessary and (b) not actually fix anything, so it's odd that it works at all after re-cloning. That suggests some sort of active corruption (hardware issue? storing repository in iCloud/Dropbox area?). – torek Jun 24 '21 at 20:26

0 Answers0