Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All :)

I posted this question in another forum but nobody has answered it so far so I'm going to try my luck here too. I hope you guys don't mind.

I have to admit I'm growing prety desperate at this point. Since there isn't much info about this error and what I managed to find didn't help. I do get it's kind of a generic error which doesn't tell what's wrong, and in all other cases I saw so far this error is accompanied with some other more specific error message. But in my case it isn't. I literally get:

C++
$ git push --set-upstream origin master                                                                                                                                                                                                                                                  
Enumerating objects: 14403, done.                                                                                                                                                                                                                                                        
error: remote unpack failed: eof before pack header was fully read                                                                                                                                                                                                                       
error: failed to push some refs to 'ivan@server.lan:~/Git-Remote/Storage/Books.git'

So any help will be appreciated! :)

I have to give you a good context of what I'm trying to do and what I've tried to fix the problem, so I'm sorry for the lenghtly post in advance.

The backup procedure.

So I use git both the standard way for source control and as a backup utility. I have a local git server set up which is on 24/7. In that server there are two 8TB hard drives. And the local machine is running windows 10 and I have git-for-windows installed.

I have multiple repos of binary data that I never modify, but only add new files to. That's pictures, music, software packages, movies etc... And the size of those repos varies between 20 to 100GB or bigger. Because of that I think it would be wasteful if the .git directory is in the repo itself. In some of the cases it's impossible, there isn't enough room in the HDD of the local machine. So before I execute:

C++
git init

in the desired directory, I open cmd as administrator, go to the soon-to-be-repo directory and type something like:

mklink /D .git //HOME-SERVER/Git-Local/Storage/Books

This way, I create a symbolic link to a directory in the remote server named .git so when I type "git init" it fills up the remote directory instead of the local one it would've created if I didn't make the symlink. Then both "git add" and "git commit" involve network operations. Those take several hours to complete.

All this data is sent into the 8TB hdd on the server named "Git-Local". Then I ssh into the server and go to the other 8TB disk named "Git-Remote" where i create a directory named say "Books.git" and inside it I type:

C++
git init --bare

Then back in the repo in the local machine I go:

C++
git remote add origin ivan@server.lan:~/Git-Remote/Storage/Books.git

And finally:

C++
git push --set-upstream origin master

You get the idea... I have done this procedure many times and It worked!

Only two repos failed to push to the remote so far with the above error message. As you can see this way I have three copies in three physical hard drives. One in the local machine and two in separate drives in the server. As you well know the .git can be cloned so it's a valid storage of data. So the repo in question "Books" has like ~30GB of pdf documents, *.doc, HTMLs, scanned books and technical videos and courses in a large somewhat messy folder structure. There are a lot of tiny > 1kB files and some large files that might be the issue. Also there might be files with long names, although I think I should get a warning if a long filename is preventing git from working.

What I have tried:

I did the procedure several times from scratch. Wiping clean both the the .git and the Book.git directories starting the process from the beginning. It didn't help.

I tried

C++
git fsck --full

but it didn't help too...

Thanks again for your patience reading through my post! :) I hope I explained the problem well. If you have any further questions feel free to ask.

P.S. For the record, I do know git isn't meant to be used like that but I like the commit history and traceability.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900