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?
$ 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 @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.