简体   繁体   English

gitignore文件忽略cachebusted文件

[英]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 我的.gitignore工作正常,但出于某种原因,我无法忽略我的/min文件夹,其中包含我的缓存已被删除的格式为whatever.min.v0.0.1.js js

Here is my current .gitignore file: 这是我目前的.gitignore文件:

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

How do I get it to ignore just everything in the public/min folder? 如何让它忽略public/min文件夹中的所有内容?

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. 这应该清除min文件夹中的任何跟踪文件,从现在开始你的.gitignore规则应该正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM