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?
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"
git fsck
did the trick and solved it for me
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With