2

I forgot to push my changes to a project I have been working on incrementally for months. This has resulted in an extremely large .git directory (~11 GB). The rest of the files in the repo combine for much less than that. I would like to push all the commits to github, if not at one time then incrementally. Thus, I am trying to push the commits one by one in order stay under the limits for each push.

My first commit's (~5.5 GB) push is failing and giving me the error fatal: protocol error: bad line length 819264.11 MiB/s.

I find somewhat similar messages when googling, but they all refer to a particular character error. I cannot seem to understand what this error I am getting is.

I am using Git 2.22.0 and macOS 10.15.4; this was pushed over HTTPS although I tried ssh and it ran into other problems, so I switched back. I had also run into another problem right before this. The steps I took before this are in more detail there.

Terminal Output with SSH:

client_loop: send disconnect: Broken pipeB | 1.39 MiB/s   
fatal: the remote end hung up unexpectedly
fatal: the remote end hung up unexpectedly

Terminal Output with HTTPS:

Enumerating objects: 667, done.
Counting objects: 100% (667/667), done.
Delta compression using up to 8 threads
Compressing objects: 100% (661/661), done.
fatal: protocol error: bad line length 819264.11 MiB/s   
error: failed to push some refs to 'https://github.com/USER/REPO.git'
  • 1
    Why is your first commit 5.5 GB in size? What are you trying to push? Do you have generated files in your repository? – bk2204 May 26 '20 at 00:16
  • Also, are you pushing over SSH or HTTPS? What version of Git are you using? What OS? Can you include more of the push output in your question as a code block? – bk2204 May 26 '20 at 00:17
  • @bk2204 no, I had just started the repo a little late into development and committed the entire block without breaking it up. I could probably break it up, but it doesn't seem to be a problem. I also added the relevant details to the question. –  May 26 '20 at 00:21
  • @matt I'm unsure why you think this would be one file. It is not. –  May 26 '20 at 00:27
  • No, I don't think it's any file. That was just a response to the way you worded the question, so I may have been misled. The related posts that I can find say it has nothing to do with _your_ file length, but rather with something about remote communication. – matt May 26 '20 at 00:28
  • @matt Sorry, I am new to SO and was encouraged to keep questions small. This seemed to be out of context. Added the output for SSH, although there is a chance I misconfigured SSH. –  May 26 '20 at 00:33
  • Have you done the usual `git config http.postBuffer` fix? – matt May 26 '20 at 00:34
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/214630/discussion-between-qag54938bcaoo-and-matt). –  May 26 '20 at 00:36
  • By the way, another thing I would try is pushing the commits one at a time, and if necessary breaking up the large first commit into multiple commits. This would not substantially damage the integrity of your history, and it would be worth it just to be able to get the stuff uploaded. – matt May 26 '20 at 00:36

1 Answers1

3

The actual message is:

fatal: protocol error: bad line length 8192

which merely has been written over an ongoing update that keeps printing the transfer rate. The last printed rate ended with ...61.11 MiB/s.

It's not clear what is causing the bad packet. I'd suggest switching to ssh, which is more likely to have solve-able problems. However, you could set the packet tracing option:

GIT_PACKET_TRACING=1 git push ...

so that you get packet-by-packet tracing, and then someone (you, probably) could spend a lot of time figuring out why they're sending a longer line than your Git is willing to receive.

Note that GitHub will not accept a file larger than 100 MB. See Repository size limits for GitHub.com.

torek
  • 448,244
  • 59
  • 642
  • 775