# \#gitinfo

**URL:** https://discourse.gohugo.io/tag/gitinfo/94.md

[Latest](https://discourse.gohugo.io/latest.md) · [Categories](https://discourse.gohugo.io/categories.md) · [Tags](https://discourse.gohugo.io/tags.md)

---

## [enableGitInfo "failed to load Git data"](https://discourse.gohugo.io/t/enablegitinfo-failed-to-load-git-data/56916)

<div class="topic-metadata">

**Author:** [@Dragan\_Espenschied](https://discourse.gohugo.io/u/Dragan_Espenschied)\
**Replies:** 5\
**Last updated:** [March 25, 2026, 7:02pm UTC](https://discourse.gohugo.io/t/enablegitinfo-failed-to-load-git-data/56916 "2026-03-25T19:02:01Z")

</div>

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 e…

---

## [GitHub Pages gets wrong gitinfo for a post page?](https://discourse.gohugo.io/t/github-pages-gets-wrong-gitinfo-for-a-post-page/52009)

<div class="topic-metadata">

**Author:** [@WRSomsky](https://discourse.gohugo.io/u/WRSomsky)\
**Replies:** 4\
**Last updated:** [October 18, 2024, 12:28am UTC](https://discourse.gohugo.io/t/github-pages-gets-wrong-gitinfo-for-a-post-page/52009 "2024-10-18T00:28:50Z")

</div>

I’m running Hugo on GitHub Pages w/ the suggested GitHub Actions. However, I’ve just noticed a discrepancy between the behavior of a locally run Hugo and the Hugo run by GitHub actions. What I first noticed was that th…

---

## [Gitinfo .Lastmod uses date of building instead of date of last commit](https://discourse.gohugo.io/t/gitinfo-lastmod-uses-date-of-building-instead-of-date-of-last-commit/50707)

<div class="topic-metadata">

**Author:** [@aurelienpierre](https://discourse.gohugo.io/u/aurelienpierre)\
**Replies:** 1\
**Last updated:** [July 15, 2024, 6:04pm UTC](https://discourse.gohugo.io/t/gitinfo-lastmod-uses-date-of-building-instead-of-date-of-last-commit/50707 "2024-07-15T18:04:45Z")

</div>

I have used enableGitInfo = true in config for 1.5 year to lazily set the .Lastmod variable to the date of the last commit. It works when building locally with hugo server. However, since Hugo 0.123 or so (and with late…

---

## [Function to return an array of \`GitInfo\`](https://discourse.gohugo.io/t/function-to-return-an-array-of-gitinfo/49821)

<div class="topic-metadata">

**Author:** [@razon](https://discourse.gohugo.io/u/razon)\
**Replies:** 4\
**Last updated:** [May 15, 2024, 4:31am UTC](https://discourse.gohugo.io/t/function-to-return-an-array-of-gitinfo/49821 "2024-05-15T04:31:05Z")

</div>

It would be nice if there is a function to return an array of Git info, such as capture and show all authors contributed to current page.

---

## [When using :git for lastmod, pages are tagged with a timestamp of Jan 01, 0001](https://discourse.gohugo.io/t/when-using-git-for-lastmod-pages-are-tagged-with-a-timestamp-of-jan-01-0001/47614)

<div class="topic-metadata">

**Author:** [@fdzero](https://discourse.gohugo.io/u/fdzero)\
**Replies:** 7\
**Last updated:** [January 1, 2024, 8:08pm UTC](https://discourse.gohugo.io/t/when-using-git-for-lastmod-pages-are-tagged-with-a-timestamp-of-jan-01-0001/47614 "2024-01-01T20:08:26Z")

</div>

I was able to overcome my last issue that I posted about with success, got everything working, then realized that my categories for blogs, were showing a date stamp of “Jan 01, 0001” even though none of the other posts o…

---

## [.GitInfo and \`fetch-depth\` when using host GUI](https://discourse.gohugo.io/t/gitinfo-and-fetch-depth-when-using-host-gui/43156)

<div class="topic-metadata">

**Author:** [@bwintx](https://discourse.gohugo.io/u/bwintx)\
**Replies:** 18\
**Last updated:** [March 1, 2023, 6:14am UTC](https://discourse.gohugo.io/t/gitinfo-and-fetch-depth-when-using-host-gui/43156 "2023-03-01T06:14:57Z")

</div>

When using a GitHub Action (GHA) to publish my site, I know (thanks to an old thread on this Discourse) to specify fetch-depth: 0 in the branch checkout so that my use of .GitInfo will produce the desired result: mainly,…
