Don't ignore file in subdirectory?

I have the following .gitignorefile

*.pyc

project/app/dist/*
project/bin/*
project/etc/*
project/var/*

!README.txt

So far, so good that most of my files are README.txtnot ignored, just like I want this to happen, except project/ect/downloads/README.txt. This file is ignored. Why is this? And how can I fix this?

If I remember correctly, I can simply add it to my project manually, but I would like to know what I am doing wrong, ignoring the file.

+5
source share
2 answers

Git project/etc/downloads/ , project/etc/*. "unanchored" !README.txt , , (.. , ).

project/etc/, Git , ( , !project/etc/important-file!), , ?).

, project/etc/*, Git , . , , Git, Git -.

, project/etc/ project/etc/* , Git -, "", .

, !README.txt, projects/etc/downloads/, , !README:

project/etc/*

# "unignore, but ignore the immediate contents of" project/etc/downloads
# so that subsequent negated patterns can apply to the immediate contents
!project/etc/downloads/
project/etc/downloads/*

!README.txt
+16

.gitignore /project/etc/ * :

!/project/etc/downloads/
/project/etc/downloads/*
+3

All Articles