threads / discuss / 31098

How to unignore files in certain directories?

Subject: How to unignore files in certain directories?

## tl;dr

2 messages between Jul 25, 2012 and Jul 25, 2012.

replies: 1people: 2as markdown or json

Peng Yu· Jul 25, 2012, 15:48 UTC · lore
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!

-- 
Regards,
Peng
Junio C Hamano· Jul 25, 2012, 18:05 UTC · re: Peng Yu · lore

Re: How to unignore files in certain directories?

Peng Yu <pengyu.ut@gmail.com> writes:
Show 10 quoted lines
> 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.

← back to recent threads