How can I prevent subdirectory matching in .gitignore?

I have a project directory that includes the following:

log/
src/log/
tests/log/
.gitignore

      

In my .gitignore file, I added the following line, assuming it would just ignore the top level log/

:

log/

      

However, he also ignores src/log

and tests/log

. How can I prevent this?

+3


source to share


1 answer


Use /log/

; this means that it will only ignore the directory log

that occurs at the top level of your project.



+3


source







All Articles