From: Junio C Hamano Date: Wed, 12 Oct 2011 23:12:13 GMT Subject: Re: Git attributes ignored for root directory Message-ID: <7vfwix7qk2.fsf@alter.siamese.dyndns.org> In-Reply-To: <4E961626.4030201@alum.mit.edu> Michael Haggerty writes: > On 10/05/2011 07:38 PM, Junio C Hamano wrote: >> - If the pattern is a single dot and nothing else, it matches everything >> in the current directory. > > This disagrees with shell usage, where "." represents a directory > itself, not the files within a directory. Either you misread me, or what I wrote was fuzzy, or perhaps both. The suggested update to the list of rules very much wants a '.' to mean the directory itself. The problem I was solving, which turned out to be something different from the original issue in the thread was this. Suppose you have a directory "foo" and want to say "I want to ignore everything in that directory". You would say "foo/" in .gitignore in the higher level and you are happy. How would you say the same thing if the directory to be ignored weren't "foo" but at the top-level of the working tree? There is no such level higher than the top-level where you can say "/" in its .gitignore file. The best you could do is to say "./" in the .gitignore file at the top-level directory, and the update rule you quoted is specifically designed to address it. Of course, you could list both ".*" and "*" in the .gitignore file at the top-level directory for the same effect, but that works only because you do not have to give values to the entry in .gitignore mechanism. It would be cumbersome to duplicate two entries in .gitattributes file like that as a workaround.