From: Junio C Hamano Date: Wed, 25 Jul 2012 18:05:10 GMT Subject: Re: How to unignore files in certain directories? Message-ID: <7vmx2nbtt5.fsf@alter.siamese.dyndns.org> In-Reply-To: Peng Yu writes: > Hi, > > I have the following in .gitignore to ignore *.txt files. > > *.txt > > But I want to keep the *.txt files in, for example, data/ and all its > subdirectories. I don't know should the the correct way to unignore > these *.txt files. Could anybody show me the command that I should add > to .gitignore? Thanks! Have you checked "git help gitignore" and looked at its example section? I think the second example is exactly the same as what you described above.