Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git ignoring all minified suffixed files

Tags:

git

gitignore

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?

like image 360
cat-t Avatar asked Sep 23 '14 04:09

cat-t


People also ask

How do I set git to ignore all text files?

If you want to ignore a file that you've committed in the past, you'll need to delete the file from your repository and then add a . gitignore rule for it. Using the --cached option with git rm means that the file will be deleted from your repository, but will remain in your working directory as an ignored file.

Why is git not ignoring files?

gitignore just ignores files that have not yet been added to the repository. If you have already git added certain files, their modifications will be tracked. Use git rm -r --cached on such files to delete them from your repository (but not from your file system).

How do I ignore unwanted files in git?

To avoid having to ignore unwanted files manually, you can create a . gitignore file in the working directory of your project. Inside this file, you can specify simple patterns that Git will use to determine whether or not a file should be ignored.


1 Answers

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
like image 50
zessx Avatar answered Sep 19 '22 14:09

zessx