The question
How do I generally .gitignore Log/log folders, but include my specific NetTerminal/Log/ folder and contents below it?
Background
We're using Azure DevOps and have a repository with the .gitignore template file "VisualStudio".
The .gitignore file has by default this line:
[Ll]og/
It happens that we have a Visual Studio project with a log class in: NetTerminal/Log/Log.cs.
The folder and the file is being ignored by git because of the default line above.
The NetTerminal folder is not below another Log folder, so that's not the reason.
I have tried adding any of the below, but they doesn't do anything, the file doesn't show up in Sourcetree's Uncommitted Changes list.
!NetTerminal/Log/
!NetTerminal/Log/*
!NetTerminal/Log/Log.cs
If I add a * to the default, as follows, now my custom file is found - but if I create a new Log folder somewhere else and add a file into it, it is also showing up, so the [Ll]og/* line is kind of ignored?
[Ll]og/*
Please advice? :-)