git error fatal protocol error bad pack header

created at 10-19-2021 views: 362

In the process of using git, the fatal: protocol error: bad pack header keeps appearing, which makes git unable to update and upload. See the following for specific errors:

fatal: git upload-pack: aborting due to possible repository corruption on the remote side.
remote: aborting due to possible repository corruption on the remote side.
fatal: protocol error: bad pack header

There are many ways to try online, such as the following:

git config --global pack.windowMemory "100m"
git config --global pack.packSizeLimit "100m"
git config --global pack.threads "1" 

I also tried to think it was a version problem, but check my git version, centos7 uses the same version for yum installation.

git version

not solved

So I took a look at the memory and saw that although it was still enough, there was no other way. So I upgraded the machine from 1C4G to 1C8G, and the problem was solved after the upgrade.

fatal protocol error

It seems that the memory is still not enough. It may be solved if the memory is released by the restart, but I did not try it here.

created at:10-19-2021
edited at: 10-19-2021: