Git ignoring all minified suffixed files

2020-04-02 07:31发布

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?

标签: git gitignore
3条回答
放荡不羁爱自由
2楼-- · 2020-04-02 07:47

just having this in the gitignore should work

*.min.*
查看更多
放荡不羁爱自由
3楼-- · 2020-04-02 07:52

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
查看更多
Bombasti
4楼-- · 2020-04-02 08:02

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)

查看更多
登录 后发表回答