0

I have this folder called 90, but the name could change into 91, 92 ecc. How can i ignore all the possibile folders that will be created?

I tried this in the .gitignore

**[90-100]/

But it didn't seem to work. Any idea would be appreciated.

3
  • .gitignore ignores lexicographically, not numerically.
    – phd
    Aug 11, 2021 at 22:46
  • so? it's impossible to do? @phd
    – giuseppe
    Aug 11, 2021 at 22:53
  • 1
    would it be a solution to create a directory that include all these numerical folders and then ignore this entire directory? Aug 11, 2021 at 23:13

1 Answer 1

3

The matching is done characterwise. You want just *[0-9]/ to match any folder name ending with at least one digit, or you can get more explicit by specifying multiple patterns like *[^0-9][1-9][0-9]/ for folder name having an exactly two-digit trailing number.

2
  • in my example notice that i use **[90-100]/, so i'm supposed to do ***[0-9]/ ?
    – giuseppe
    Aug 12, 2021 at 8:38
  • [90-100] matches characters 9, 0-1, 0 or 0.
    – jthill
    Aug 12, 2021 at 9:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.