I'm getting an odd error when I try to push to a new remote repository. I'm a git newbie, but following some tutorials, I was able to setup a few test repositories on a remote server and push to them. But the main repository I want to push up is giving me trouble. Here's what I did.
On the remote server I created a new directory. I then initialized a bare git repository inside that directory. On my machine I added the remote, and then I pushed to remote site. It looked like it was working, but after a little while I came back and found this error.
Counting objects: 4364, done. Delta compression using up to 2 threads. Compressing objects: 100% (4240/4240), done. error: pack-objects died with strange error | 44 KiB/s error: failed to push some refs to 'mysite:main_site_repo'
What could be wrong? In this repository, I do have开发者_如何学C a few media files (about 40MB each). Could they be a problem? I don't get any timeout errors, but I do see that it makes it through about 44MB before failing. Is there a way to have git spit out debug info?
Also I accidentally let this repository fall off the main branch and made a few commits while not on any branch. I merged everything back into the main branch and am now working from there again, but could this be the source of the problem?
git version on my computer: 1.6.4.4 git version on server: 1.6.2.3
Do you have any large binary file? Git does not handle large binary files well. It is running out of memory. Try to disable delta and try again.
Use:
*.iso binary -delta
in your .gitattribute
, where *.iso
is your large file name
Thanks to everyone for the responses. I will remember to check those things the next time something like this happens. It turns out though that this time the issue was caused by the server I was pushing to killing my long running process as part of a security precaution. I've chatted with the administrator and he's updated it so my push will work now.
Thanks again to everyone for all the help.
I've often received this error as a result of a permissions error where some files in the object directory are owned by the wrong user. This happens if you push to a repository locally as one user but push to that same repository remotely (over SSH) as a different user, as is often the case with gitosis. But the situation can happen in other contexts as well.
Unfortunately, the error message is rather vague and can point to a number of issues. The most common problem is that the version of Git on the remote server is different from the version used to push locally. I noticed that your local version of Git is 1.6.4.4, and the remote version is 1.6.2.3. Upgrade the Git version on the server to 1.6.4.4 and see if the problem goes away.
精彩评论