sds sds - 1 year ago 111
Git Question

How do I ignore numeric logs in git?


creates logs like
, ...,

How do I ignore all these in
? (I know that
are ignored automatically).

E.g., adding


would probably work for the first 1,000 log files, it looks ugly.

Is there a better way?

Answer Source

If you want to be really precise and ignore only files with numeric suffix after .log. and excluding things like x.log.1bar, then this will do it:


This will match everything containing .log., excluding patterns where the suffix after .log. contains non-digits. This also excludes *.log.. In effect, it matches only files with numeric suffix after .log..

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download