VAAA VAAA - 28 days ago 16
Git Question

How to exclude project from .gitignore

I have a Visual Studio solution, inside my solution I created a new project named:

MyProject.Log


I committed but saw there is nothing to commit.

Then I opened my .gitignore file and saw a *.log and [Ll]og/. So Im sure that why
MyProject.Log
folder is exluded.


What do I have to add in my .gitignore file so my new project is added but everything inside is filtered with the .gitignore patterns?

Answer

Try adding !MyProject.log to the .gitignore file. The ! reverses the exclusion. Put it after the pattern that excludes it.