I want to ignore some folders generated with random numeric names even float numbers, but I do not know how to peek them to include in the .gitignore file
How about something like:
* //Ignore everything
!*[!0-9.]* //Except things with some characters besides numbers (and period, for decimals) in them
!*.*.* //And except things with two periods, since these can't be numbers
Note that these are shell globs instead of regular expressions.
Ideally, if gitignore supported regular expression, it might have been possible to use a regex as detailed here.
However, from the official git documentation here :
Otherwise, Git treats the pattern as a shell glob suitable for consumption by fnmatch(3) with the FNM_PATHNAME flag: wildcards in the pattern will not match a / in the pathname. For example, "Documentation/*.html" matches "Documentation/git.html" but not "Documentation/ppc/ppc.html" or "tools/perf/Documentation/perf.html".
Regular expression is not supported at the time of this writing (2016-11-15) and the expressions in gitignore are interepreted as shell glob patterns.
If the random folders being generated do not share a common parent directory and there is nothing else common in their names, then this does seem to be possible.
Is it possible to generate the folders with a common prefix or suffix so that that can be used in the .gitignore?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With