Hello all,
To get portable last modified dates for my pages, I set enableGitInfo to true in my configuration.
My whole site project is managed via git. However, when starting hugo or hugo server, I get the following error message:
Start building sites …
hugo v0.157.0-7747abbb316b03c8f353fd3be62d5011fa883ee6 linux/amd64 BuildDate=2026-02-25T16:38:33Z VendorInfo=gohugoio
Built in 5 ms
ERROR error building site: assemble: failed to create page from pageMetaSource : "<pathy_mc_pathface>/content/_index.md:1:1": failed to load Git data: fatal: unable to read tree (600eff68038faba92f7ee6314b1ee0dcca2692c1)
The file in question is managed via git, and I can retrieve its last modified date via git:
$ git log -1 _index.md
commit d3333212a3a3c2bfc17e8e56b23760fa861a9c2c
Author: Dragan Espenschied <me@my.mail>
Date: Fri Mar 20 14:09:21 2026 +0100
manual summary for home page (bad summary)
I do not know what’s wrong here. Anybody have an idea?
Bests,
Dragan
What is the result of each command?
git version
git cat-file -t 600eff68038faba92f7ee6314b1ee0dcca2692c1
git fsck --missing
git rev-parse --is-shallow-repository
$ git version
git version 2.53.0
$ git cat-file -t 600eff68038faba92f7ee6314b1ee0dcca2692c1
fatal: git cat-file: could not get object info
$ git fsck
Checking ref database: 100% (1/1), done.
Checking object directories: 100% (256/256), done.
error: 600eff68038faba92f7ee6314b1ee0dcca2692c1: invalid sha1 pointer in cache-tree of .git/index
broken link from tree 219a840c9359cfa53431cb6b2426427917c3c332
to tree 600eff68038faba92f7ee6314b1ee0dcca2692c1
missing tree 600eff68038faba92f7ee6314b1ee0dcca2692c1
dangling blob 6047b2522fadf5246f997dedda54646154bc5b89
$ git rev-parse --is-shallow-repository
false
Thank you so much @jmooring!
It looks like indeed the repo is corrupted.
Is there anything I could do to repair it?
PS: git fsck --missing returned error: unknown option `missing’ + a list of allowed options. The command was useful without this constraint though
You could try git fetch --all, but I’d probably do a fresh clone.
The above assumes your remote is up-to-date.
Thank you @jmooring, a full fresh close from the remote solved the issue. I was lucky enough for the remote to be fully intact.
The git commands you mentioned will also help me in the future to track down similar issues. 