We are running git v1.7.1 and have gitweb configured. We also use gitolite for administration, but I do not believe that is germane to this issue. From time to time we get an error in the Apache log like:
missing object 0000000000000000000000000000000000000000 for refs/heads/...
Where the elipse at the end is typically a branch name. I believe that the string of zeros is suppost to be a SHA1 value. Obviously, all zeros is not a SHA1 value. It is not clear to me where this value is comming from?
I have run git fsck on the server and it did not report an issue, however git gc resolves the problem. Also, we are able to pull and push to this repository (and that branch) fine. Only gitweb appears to be effected.
I know others have seen this issue becuase there is a closed question about it here: Gitweb failure: fatal: missing object 0000000000000000000000000000000000000000 for refs/heads/master There is no answer to that question.
Additional Information
We have now seen this isssue on our gitolite-admin repository. We do not have branches in our gitolite-admin repository, so this was not on a branch.
A commit gets rejected and causes a failed to push some refs to error because the remote branch contains code that you do not have locally. What this means is that your local git repository is not compatible with the remote origin. Here is an abstraction of what incompatibility looks like in Git:
This is one of the most common errors, especially for newcomers to Git. Let’s suppose that you want to run git status in a particular directory: The error indicates that the command cannot be executed because the current directory is not a Git directory. Usually, there are two main reasons why you might be getting the error.
This error occures because it might possible that there is a branch with the same name already exist, or there is a branch is already created with the same name pattern. Git Error: error: cannot lock ref "refs/heads/ABC-1001/xyz": "refs/heads/ABC-1001 exists; cannot create "refs/heads/ABC-1001/xyz"
You got a ‘master (fetch first)’ error with a ‘failed to push some refs to’ error When this occurs, someone has pushed to the branch before you. Git wants you to pull first before you can push your committed changes.
This error occurred for me after the default branch on the remote was changed and the former default branch was deleted. My local repository still had a reference to the deleted branch in
.git\refs\remotes\origin\HEAD
I simply updated this to reference the new default remote.
Check the umask value of the user running git-daemon. Setting it to 022 may help you (look at 'man umask').
I have also found a similar issue locally for one of my projects. For me the behaviour is the following:
git fetch
i get error: refs/heads/test_theme does not point to a valid object!
git branch
i get fatal: missing object 97fe4dfaa2bfb3768f42bb5caca1c7cd37a26734 for refs/heads/test_theme
I can't really say I remember what I did with that branch and when. Sorry.
However, the error goes away when I do rm -rf /path/to/project/.git/refs/heads/test_theme
.
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