April 12, 2020 — kyle.huynh205
How to resolve “fatal: protocol error: bad pack header” error when running “git pull …”
Encountered this issue with this Git:
remote: Counting objects: 1702, done.remote: fatal: unable to create thread: Resource temporarily unavailableerror: git upload-pack: git-pack-objects died with error.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
Reason:
- A repository with lots of large files, which can cause re-packing to take a lot of memory.
- Limited virtual memory – either in general, or just for that account due to the
ulimitsetting
Solution:
git config --global pack.windowMemory "100m"git config --global pack.packSizeLimit "100m"git config --global pack.threads "1" a
Finally, running Git pull command.