How to exclude folders in range with gitignore

Issue

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.

Solution

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.

Answered By – jthill

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published