{"thread":{"id":"31098","subject":"How to unignore files in certain directories?","startedAt":"2012-07-25T15:48:52Z","lastAt":"2012-07-25T18:05:10Z","messageCount":2,"participants":["Peng Yu","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"195757","messageId":"CABrM6wk+acut6EaoK=_GuQw3w9vhn_4ONoF21cj1GtEtHFWBKQ@mail.gmail.com","threadId":"31098","inReplyTo":null,"subject":"How to unignore files in certain directories?","fromName":"Peng Yu","fromEmail":"pengyu.ut@gmail.com","sentAt":"2012-07-25T15:48:52Z","receivedAt":"2012-07-25T15:48:52Z","isPatch":false,"sender":{"key":"pengyu.ut@gmail.com","avatar":null},"body":"Hi,\n\nI have the following in .gitignore to ignore *.txt files.\n\n*.txt\n\nBut I want to keep the *.txt files in, for example, data/ and all its\nsubdirectories. I don't know should the the correct way to unignore\nthese *.txt files. Could anybody show me the command that I should add\nto .gitignore? Thanks!\n\n-- \nRegards,\nPeng\n"},{"id":"195773","messageId":"7vmx2nbtt5.fsf@alter.siamese.dyndns.org","threadId":"31098","inReplyTo":"CABrM6wk+acut6EaoK=_GuQw3w9vhn_4ONoF21cj1GtEtHFWBKQ@mail.gmail.com","subject":"Re: How to unignore files in certain directories?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-07-25T18:05:10Z","receivedAt":"2012-07-25T18:05:10Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Peng Yu <pengyu.ut@gmail.com> writes:\n\n> Hi,\n>\n> I have the following in .gitignore to ignore *.txt files.\n>\n> *.txt\n>\n> But I want to keep the *.txt files in, for example, data/ and all its\n> subdirectories. I don't know should the the correct way to unignore\n> these *.txt files. Could anybody show me the command that I should add\n> to .gitignore? Thanks!\n\nHave you checked \"git help gitignore\" and looked at its example\nsection?  I think the second example is exactly the same as what you\ndescribed above.\n"}]}