wired_in wired_in - 1 year ago 104
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?

Answer Source

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:

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