Sass resources tracked in git

Some resources/_gen files are being tracked in git despite my efforts to ignore them, such as:


I’m unsure what I’m doing wrong here, as each change to the CSS is also tracking these files, which I don’t think is necessary. Or at least I don’t want that to happen.

I’m using fingerprinting in Sass pipes generation, like so:

{{ $options := (dict "targetPath" "css/styles.css" "enableSourceMap" true) }}
{{ $style := resources.Get "scss/styles.scss" | resources.ToCSS $options | fingerprint }}
<link rel="stylesheet" href="{{ $style.RelPermalink }}" media="screen">

My .gitignore has this line:


Is there anything else in .gitignore file?
What is the path to your .gitignore file?
Do you have .gitignore files in multiple directories?

A link to the public repository for your site would be helpful.

Thanks for the reply. Unfortunately my project is not public at this time. Here is my full .gitignore:

# Logs

# Dependency directories






The .gitignore file is in my Hugo project root.

From the root of your project, type:

git check-ignore <path-to-file-you-are-curious-about>

If the path is ignored, it will be printed after the command executes. If it is not ignored, nothing will print.


Another question… is it possible that you started tracking these particular files before you added resources/ to your .gitignore file?

The purpose of gitignore files is to ensure that certain files not tracked by Git remain untracked. Files already tracked by Git are not affected; see the NOTES below for details.

To stop tracking a file that is currently tracked, use git rm --cached .

That looks like the issue here. They were files that were added again at some point, and un-tracking them seems to have worked.


This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.