Exceptions in .gitignore

pistacchio picture pistacchio · Mar 10, 2010 · Viewed 56.1k times · Source

How can I add an exception to .gitignore, like "ignore all the .dll files BUT myfile.dll"?

Answer

Ben James picture Ben James · Mar 10, 2010

Use ! to negate the pattern:

*.dll
!myfile.dll