From: Junio C Hamano <gitster@pobox.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Max Power <mkwright@gmail.com>, git@vger.kernel.org
Subject: Re: git ignore
Date: Tue, 16 Dec 2008 15:08:20 -0800 [thread overview]
Message-ID: <7viqpjra57.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <alpine.LFD.2.00.0812161450010.14014@localhost.localdomain> (Linus Torvalds's message of "Tue, 16 Dec 2008 14:53:07 -0800 (PST)")
Linus Torvalds <torvalds@linux-foundation.org> writes:
> 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
next prev parent reply other threads:[~2008-12-16 23:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-16 22:43 git ignore Max Power
2008-12-16 22:53 ` Linus Torvalds
2008-12-16 23:08 ` Junio C Hamano [this message]
2008-12-18 17:11 ` [PATCH] test overlapping ignore patterns Michael J Gruber
2011-07-07 18:12 ` Stephen Haberman
2011-07-08 18:01 ` Junio C Hamano
2011-07-08 18:39 ` Stephen Haberman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7viqpjra57.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=mkwright@gmail.com \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).