Thread (3 messages) 3 messages, 3 authors, 2016-06-15

Re: git ignore

flat view

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:45:47

Possibly related (same subject, not in this thread)

Linus Torvalds [off-list ref] writes:
On Tue, 16 Dec 2008, Max Power wrote:
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help