Mike Fielden
Mike Fielden

Reputation: 10153

gitignore file ignore cachebusted files

I have my .gitignore working fine but for some reason I cannot get it to ignore my /min folder which contains, among other things, my cache busted js in the format of whatever.min.v0.0.1.js

Here is my current .gitignore file:

node_modules/
.sass-cache/
public/stylesheets/*.css
public/min/*.js

How do I get it to ignore just everything in the public/min folder?

Upvotes: 4

Views: 820

Answers (1)

Matt Cooper
Matt Cooper

Reputation: 10840

Your ignore rule looks correct as long as that is the correct folder structure so my guess is that you are trying to ignore files which you were previously tracking changes on?

Try running the following:

git rm --cached public/min/*

That should clear any tracked files within the min folder and from now on your .gitignore rule should work correctly.

Upvotes: 4

Related Questions