Git ignoring all shortened suffix files

I currently have something like:

javascripts/ plugin.js plugin.min.js stylesheets/ style.css style.min.css 

How can I make all .gitignore ignore all mini files ( .min )? Would something like **/*.min.* Work?

+6
source share
3 answers

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

Ignore all mini files in the project:

 *.min.* 

Ignore all mini files in the folder:

 assets/*.min.* 

Ignore only mini JS / CSS files in your project:

 *.min.js *.min.css 
+12
source

just having this in gitignore should work

 *.min.* 
+3
source

I believe you need git rm filename --cached delete files from your git repository if after that you add it to .gitignore. (note: this will remove it from the repo, not from the directory)

0
source

Source: https://habr.com/ru/post/975693/


All Articles