Git ignoring all minified suffixed files

Deadly 提交于 2019-12-01 15:09:11

问题


I currently have something like:

javascripts/
    plugin.js
    plugin.min.js

stylesheets/
    style.css
    style.min.css

How would I get all .gitignore to ignore all minified (.min) files? Would something like **/*.min.* work?


回答1:


You have several solutions, depending of what you really need.

Ignore all minified files in your project :

*.min.*

Ignore all minified files in a folder :

assets/*.min.*

Ignore only JS/CSS minified files in your project :

*.min.js
*.min.css



回答2:


just having this in the gitignore should work

*.min.*



回答3:


I believe you have to git rm filename --cached to remove the files from your git repo if you added it to .gitignore afterwards. (note: this will remove it from the repo, not from directory)



来源:https://stackoverflow.com/questions/25987084/git-ignoring-all-minified-suffixed-files

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!