Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitX-L: missing object 0000000000000000000000000000000000000000

Tags:

git

gitx

I'm getting the following error in GitX-L when opening a git repository:

The document “REPO_NAME” could not be opened.

An error occured while trying to open file://localhost/Volumes/SERVER/www/REPO_NAME/.git/.
fatal: missing object 0000000000000000000000000000000000000000 for refs/remotes/origin/HEAD

Does anyone know what is causing this issue or how to fix it? I don't get the error while using the command line, so I'm assuming it is a problem with GitX-L.

git fsck does tell me about a bunch of dangling entries, could those be to blame?

like image 835
Thomas Hunter II Avatar asked Dec 16 '22 00:12

Thomas Hunter II


2 Answers

I had the same error message when opening a repository in 'GitX' (a GUI tool).

For me, the problem was caused by the file .git/refs/remotes/origin/HEAD, which referenced a remote branch which I had deleted:

ref: refs/remotes/origin/develop

I fixed it by editing the file to contain the name name of a remote branch which did still exist:

ref: refs/remotes/origin/master
like image 70
Jonathan Hartley Avatar answered Dec 19 '22 06:12

Jonathan Hartley


It looks like something is wrong with the origin remote ref... Remove the culprit from Terminal with git branch -r -d origin/HEAD, or even git remote prune origin and re-open it in GitX.

like image 39
CharlesB Avatar answered Dec 19 '22 08:12

CharlesB