Re: git ignore
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 16, 2008, 23:08 UTC
- Message-ID
- <7viqpjra57.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <alpine.LFD.2.00.0812161450010.14014@localhost.localdomain>
Linus Torvalds <torvalds@linux-foundation.org> writes:
Show 12 quoted lines
> On Tue, 16 Dec 2008, Max Power wrote: >> >> So I understand how to use the .gitignore file to ignore specific >> files/directories that I put in there... is there a way to ignore everything >> BUT a given file extension? > > Something like > > * > !*.jpg > > to only save the jpegs in your pr0n collection?
Hmm, do people still keep p0rn collection in jpgs? I somehow had an impression that they moved to avis ;-)
> The first rule says "ignore everything". The second one says "don't > ignore *.jpg files". > > Untested.
t3001-ls-files-others-exclude.sh has some tests but there is nothing that explicitly tests overlapping patterns. Perhaps it should (hint, hint...)
"man gitignore" documentation has an example to ignore all *.html files but not foo.html using a similar construct, i.e.
*.html
!foo.html