gitgithubsugarcrm

Git error: remote unpack failed when pushing to a bare repo


I'm having trouble with switching my local SugarCRM instance from a gitlab repo to a new github repo. Locally, the project is on a vagrant VM running on a Windows 10 host. I run git commands from the host machine. I created a new private github repo, set it as the new remote, and generated a new public/private ssh key pair on the host machine in C:\Users\.ssh. When I try to push the project to the remote repo for the first time, I get

Enumerating objects: 58649, done.
error: remote unpack failed: eof before pack header was fully read
error: failed to push some refs to 'git@github.com:yvoloshin-fidelus/Sugar.git'

This image shows a more detailed error message that I got from Github Desktop.

While following this SO post, I tried

git gc --aggressive --prune=now

and got this:

fatal: bad object refs/remotes/origin/HEAD
error: failed to run repack 

Other git commands I tried with their outputs:

git count-objects -vH

warning: garbage found: .git/objects/pack/tmp_pack_2dy4gc
warning: garbage found: .git/objects/pack/tmp_pack_tnF02a
warning: garbage found: .git/objects/pack/tmp_pack_XY7JBa
count: 4904
size: 10.77 MiB
in-pack: 68200
packs: 4
size-pack: 1.15 GiB
prune-packable: 0
garbage: 3
size-garbage: 1.32 GiB

git gc --aggressive --no-prune

Enumerating objects: 65624, done.
error: failed to run repack25/65624)

These commands had no effect on the original error. What else should I try here?


Solution

  • EDIT/UPDATE: What actually did the trick for OP was git update-git-for-windows. See comments for details!

    Things I'd try in such situations: