Search code examples
gitgithub

How do I fix "The remote disconnected." on GitHub?


I'm trying to create and upload a repertoire to manage the existing project on GitHub, but I can't push as errors keep popping up. I also upgraded the plan and changed it to Pro.

If I run "cmd" with administrator privileges and run all of the code to get the result value below and push, the error will continue. What should I do?

git lfs install
git lfs track "*.png"
git add .gitattributes
git commit -m "create .gitattributes"
git push origin master
git add .
git commit -m "upload source code"
git push origin master

D:\Git\ALT-F4>git push origin master
Uploading LFS objects: 100% (1/1), 106 MB | 0 B/s, done.
Enumerating objects: 3885, done.
Counting objects: 100% (3885/3885), done.
Delta compression using up to 12 threads
Compressing objects: 100% (3884/3884), done.
error: RPC failed; HTTP 500 curl 22 The requested URL returned error: 500
send-pack: unexpected disconnect while reading sideband packet
Writing objects: 100% (3884/3884), 2.04 GiB | 8.85 MiB/s, done.
Total 3884 (delta 2357), reused 0 (delta 0), pack-reused 0
fatal: the remote end hung up unexpectedly
Everything up-to-date

I even tried these two codes, and the results were the same.

git config --global http.postBuffer 524288000
git config --global http.postBuffer 2097152000

enter image description here

enter image description here

enter image description here


Solution

  • GitHub is timing out on your push, because you're pushing more than 2 gigabytes (with only about 106MB in LFS). This is intentional; GitHub has finite resources, and if anyone can occupy those resources forever with endless repository pushes then they can effectively destroy GitHub's ability to handle other, smaller, requests.

    Reduce the size of your repository - do you really need to track changes in every file there? - or get more into LFS.