Can I gitignore files with a prefix?
Asked Answered
S

2

13

I have file a.css and b.css in the same folder. My framework combines those files in a file called temp.a12cab4598347b07f0079d.css This file will be generated wherever there is a css file, so folder matching is no good. Can I ignore all these files using something like

temp.*.css

Thank you

Shiff answered 17/8, 2015 at 15:54 Comment(2)
Have you tried to add your mask to .gitignore? it works well.Bearded
reading this answer after almost 2 years of having posted it, I realize that my true lacking area was linux globbing, I didn't know anything about globbing and now that I do it certainly helps with understanding how git ignore files are structured, for anyone in my situation, maybe someone that uses windows for programming, lookup this term, globbing.Shiff
G
24

It will work as expected.

Also, if you need to do this recursively in any subdirectory

**/temp.*.css
Glaucoma answered 17/8, 2015 at 16:1 Comment(1)
I was not very familiar with globbing in general, it seems that git patterns look a lot like linux console globbing wildcards, am I right?Shiff
A
3

Yes, that works just fine. The wildcard character in the middle of your string works well.

A great reference for gitignore patterns, matching, and rules is the official documentation on gitignore.

Algonquin answered 17/8, 2015 at 15:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.