Anyone familiar with the git error “missing object 0000000000000000000000000000000000000000 for refs/heads/…”?

China☆狼群 提交于 2019-12-05 01:16:22

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').

This is the default for a branch with no commits. When you push a new branch, you will see in the output 00000->ef357 or something like that.

It could also be caused by case sensitive stuff.

piksi

This happens for me whenever a repo gets updated and the permissions are set incorrectly for Apache.

I've set a script hook to run after each commit to fix the permissions (instructions here http://sitaramc.github.com/gitolite/hooks.html). I've added Apache to the git group, and thus all of the files must be readable by the gitweb cgi run by Apache. I am considering using suexec to remedy this.

I have also found a similar issue locally for one of my projects. For me the behaviour is the following:

  • on git fetch i get error: refs/heads/test_theme does not point to a valid object!
  • on 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.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!