hugo v0.152.2+extended linux/amd64 BuildDate=2025-12-14T00:00:00+00:00 VendorInfo=Fedora:0.152.2-1.fc43
Hello, I have just learned a lot with the help of @irkode regarding which files Hugo ignores and does not ignore during a build process, in my post:
To correct the err in my ways, I would now like to learn git and want to start off with a local git repo.
If in my hugo site folder I do “git init” then git creates a folder “.git” in the site folder.
I am concerned that Hugo will parse this .git folder since it is under the site folder.
I have not been able to find info regarding what files and folders Hugo ignores by default (I mean without specifying ignoreFiles and ignoreFiles does not apply to all folders anyways).
I have also asked AI, and AI #1 says that by default Hugo ignores any .file or .folder in any folder of Hugo including eg in /layouts/ and its subfolders.
But AI being AI, AI #2 says Hugo ignores any
_file or _folder
But I doubt that would be correct since Hugo uses eg the _shortcodes folder.
So I would like to ask:
Is using .git folder under a Hugo site folder ok?
Is it correct that Hugo will ignore any .file or .folder in any subfolder of the main site folder? EG if I had .shortcode.html in the _shortcodes folder, would Hugo ignore this?
Is there some docs that describe this default ignore behavior? Sorry but I have not been able to find this.
Thanks ahead of time for any help.