.gitignore for Hugo
8 ignore rules for Hugo, ready to copy into your repository.
Fast static site generator
The complete .gitignore for Hugo
# Generated by LFGitignore - https://lfgitignore.com
# Created: 2026-08-05 01:33:03 UTC
# Technologies: Hugo
### Hugo ###
/public/
/resources/_gen/
/assets/jsconfig.json
hugo_stats.json
hugo.exe
hugo.darwin
hugo.linux
/.hugo_build.lock
What these Hugo rules actually ignore
Every pattern below, and why it belongs in your .gitignore.
Generated files by hugo
| Pattern | What it ignores |
|---|---|
/public/ |
Generated files by hugo |
/resources/_gen/ |
Generated files by hugo |
/assets/jsconfig.json |
Generated files by hugo |
hugo_stats.json |
Generated files by hugo |
Executable may be added to repository
| Pattern | What it ignores |
|---|---|
hugo.exe |
Executable may be added to repository |
hugo.darwin |
Executable may be added to repository |
hugo.linux |
Executable may be added to repository |
Temporary lock file while building
| Pattern | What it ignores |
|---|---|
/.hugo_build.lock |
Temporary lock file while building |
How to use this .gitignore for Hugo
- Copy the Hugo rules above, or download the file directly.
- Create a file named .gitignore at the root of your Git repository and paste the rules into it.
- If some of those files are already tracked, run git rm -r --cached . then commit again — Git only applies ignore rules to untracked files.
- Commit the .gitignore so everyone on the team shares the same rules.