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?
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:
sudo chown -R --changes "$USER" .git
ā Replace all child object permissions with inheritable permissions from this object
).git/objects/fe/73f087d8c25fbc1159a50434ef9bf15773e7ac
) have a length of 55 characters. Also that special unicode characters can consume more than 1 byte of the file path. Also files in the repo that exceed the maximum path lengths can become problematic for some operations. In worst case just move the repo to e.g. C:\repo\
or something in similar length and try there.git clone ./repo newrepo
and retry the push from within the new repo clone