Possible Duplicate:
Git - Whitelisting files in a complex directory structure
I'd like to have a git repository track only files named e.g. SOURCES
while everything else shall be ignored (take e.g. a tree of pdf files where each SOURCES
file lists their origins). The simplest shot would have been
*
!SOURCES
in .gitignore
. However the exclusion of e.g. A/SOURCES
is overridden by the *
, requiring me to use git add -f
. How can .gitignore
be modified to ignore everything except files named SOURCES
without requiring a forced add?
edit The solution posted here will not do since the directory structure is not fixed, i.e. new directories containing a SOURCES
file should not have to be added to .gitignore
by hand...