From: Jonathan Nieder Date: Thu, 12 Aug 2010 20:40:52 GMT Subject: Re: [RFC/PATCH] git-add: Don't exclude explicitly-specified tracked files Message-ID: <20100812204051.GF2029@burratino> In-Reply-To: Greg Brockman wrote: > For example, in my personal usage, when I ignore a directory but track > some files within it, this is because I don't want to specify an > ignore for every single other file in that directory. Also note that > negated .gitignore entries don't seem to work in this case, i.e. a > .gitignore with contents > dir > !dir/file > won't actually let file be addable again. Aside: yeah, this is something I have run into before. The workaround I used was to use a dir/.gitignore instead, like this: * !/file which is ugly. Maybe git should get internal support for something like dir/** (meaning “all files under dir”) and “!dir/file” could be internally munged to !/dir dir/** !dir/file when it appears after “dir”.