Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error: remote unpack failed: eof before pack header was fully read

Tags:

git

Before that I got a problem error: object file is empty cause my laptop sunddenly turn off. I was fixed with this. My local repo was fixed and I try to pull and push to remote master. But I have a problem like this

$ git push -u origin master
Counting objects: 26, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (22/22), done.
fatal: unable to read c779d43453f63d871ba2a079b79f04558d9b0920
error: remote unpack failed: eof before pack header was fully read
error: failed to push some refs to '[email protected]:xxxx/xxxx.git'

How to fix my remote repo? I can't push my new commit cause broken remote repo

How to fix unable to read c779d43453f63d871ba2a079b79f04558d9b0920 on remote repo?

like image 945
Black Initial Avatar asked Jan 22 '19 03:01

Black Initial


Video Answer


4 Answers

I'm on a shared hosting and I had the same problem while trying to push master for the first time.

But this did the trick:

git config --global pack.windowMemory "100m"
git config --global pack.packSizeLimit "100m"
git config --global pack.threads "1"
like image 82
Julien Avatar answered Sep 19 '22 14:09

Julien


git fsck

did the trick and solved it for me

like image 26
Megacier Avatar answered Sep 18 '22 14:09

Megacier


I had this occur for me in a number of repos, I eventually traced it back to the repos being stored inside of my Dropbox and "selective sync" being applied. As a result the .git folder wasn't fully available locally.

Going into the folder in finder and selecting selective sync > local fixed it.

The parent folder was marked to be synced, but Dropbox seems to assume that hidden folders probably aren't important.

like image 34
Jan Avatar answered Sep 18 '22 14:09

Jan


I had the same problem yesterday, my laptop shut down unexpectedly. So I had to re-create git.

First of all, remove the .git folder from your directory.

rm -rf .git

Then create renew git.

git init

All the tracking will become new, so you have to commit all the new changes and add your remote repository

git remote add origin <repo URL>

If for example, you were on the "development" branch. Go ahead create a development branch

git branch development && git checkout development

Now after switching to the development branch, pull from the remote branch.

git pull origin development --allow-unrelated-histories

You may face conflicts, resolve them and you are good to go.

like image 39
PanAfricanChild Avatar answered Sep 20 '22 14:09

PanAfricanChild