wired_in wired_in - 2 months ago 5
Git Question

Ignoring file extensions

I just encountered a situation where my .gitignore was ignoring folders that contained ".lib" because of a rule intended to ignore files with the extension .lib.

My .gitignore had "*.lib" as a rule, and there is a folder called "Main.Lib" that was also getting ignored.

How do I make sure only files with the extension .lib are ignored?


An ending / means directory. And a line beginning with an exclamation mark means not.

And since later lines have precedence, this .gitignore will do what you need: